How to integrate TCS api with odoo 9 - api

Please tell me how to integrate TCS Api in Odoo . I have some nominal code but i don't know this is a APi or not . If this is a Api then please tell me how i use this Code
The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.
POST /Service1.asmx HTTP/1.1
Host: 202.61.51.93
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://202.61.51.93:6265/GetAllCountries"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetAllCountries xmlns="http://202.61.51.93:6265/" />
</soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetAllCountriesResponse xmlns="http://202.61.51.93:6265/">
<GetAllCountriesResult>xmlxml</GetAllCountriesResult>
</GetAllCountriesResponse>
</soap:Body>
</soap:Envelope>

Related

How to embed CDATA in Mulesoft

I'm trying to embed a literal CDATA value in a Mulesoft flow and cannot figure out how to do so.
My desired output (in an HTTP request body) is:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<query xmlns="http://autotask.net/ATWS/v1_5/">
<sXML>
<![CDATA[<queryxml><entity>ticket</entity><query><condition><field>id<expression op="equals">12345</expression></field></condition></query></queryxml>]]>
</sXML>
</query>
</soap:Body>
</soap:Envelope>
My Dataweave transformation looks as follows:
%dw 1.0
%output application/xml
%namespace soap http://schemas.xmlsoap.org/soap/envelope
---
{
soap#Envelope #(version: "1.0") : {
soap#Header: {},
soap#Body: {
query: {
sXML: "<queryxml><entity>ticket</entity><query><condition><field>id<expression op=\"equals\">12345</expression></field></condition></query></queryxml>"
}
}
}
}
But when I send this request to requestb.in (to inspect the contents), I can see it's coming through like this (focus on the sXML entity):
<?xml version='1.0' encoding='UTF-8'?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope" version="1.0">
<soap:Header/>
<soap:Body>
<query>
<sXML><queryxml><entity>ticket</entity><query><condition><field>id<expression op="equals">12345</expression></field></condition></query></queryxml></sXML>
</query>
</soap:Body>
</soap:Envelope>
How can I get a literal CDATA value in there via dataweave / MEL?
Thank you.
I would try:
sXML: "<queryxml> .... </queryxml>" as :cdata
See https://docs.mulesoft.com/mule-user-guide/v/3.8/dataweave-formats#custom-types-2 for more information.
handleInteractiveOrder:
write(vars.subm.soap#Envelope.soap#Body.cp#handleInteractiveOrder,"application/xml")
as CData
in mule 4 we can do like this. I kept my XML in subm variable.

RequestRecipientToken returns Unspecified_Error

I am trying to request for a token from my client app implemented in Objective-C.
I first call CreateEnvelopeFromTemplate to get an envelopeID.(It works file)
I then, pass this envelopeID to RequestRecipientToken. Unfortunately, RequestRecipientToken returns Unspecified_Error to me. I cross-checked the SOAP request of RequestRecipientToken as well as the headers didn't find anything wrong.
I've copied the SOAP request and response along with the headers for both the methods.
**CreateEnvelopeFromTemplate Request**
{
"Content-Length" = 2725;
"Content-Type" = "application/soap+xml; charset=utf-8";
Host = "demo.docusign.net";
SOAPAction = "http://www.docusign.net/API/3.0/CreateEnvelopeFromTemplates";
"User-Agent" = wsdl2objc;
"X-DocuSign-Authentication" = "<DocuSignCredentials><Username>dubeynikhileshs#gmail.com</Username><Password>myPassword</Password><IntegratorKey>XORI-84155a30-597a-4821-918a-40551d71dcff</IntegratorKey></DocuSignCredentials>";
}
2013-08-03 21:24:06.619 DocuSignFramework-ObjC[2809:c07] OutputBody:
<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:APIService="http://www.docusign.net/API/3.0" xsl:version="1.0">
<soap:Body>
<APIService:CreateEnvelopeFromTemplates>
<APIService:TemplateReferences>
<APIService:TemplateReference>
<APIService:TemplateLocation>Server</APIService:TemplateLocation>
<APIService:Template>5AB61121-DBEF-4403-BD2C-77B6E2E427F0</APIService:Template>
<APIService:RoleAssignments>
<APIService:RoleAssignment>
<APIService:RoleName>Signer</APIService:RoleName>
<APIService:RecipientID>1</APIService:RecipientID>
</APIService:RoleAssignment>
</APIService:RoleAssignments>
<APIService:FieldData>
<APIService:DataValues>
<APIService:DataValue>
<APIService:TabLabel>Full Name 1</APIService:TabLabel>
<APIService:Value>John Smith</APIService:Value>
</APIService:DataValue>
<APIService:DataValue>
<APIService:TabLabel>Company 3</APIService:TabLabel>
<APIService:Value>MyCompany</APIService:Value>
</APIService:DataValue>
</APIService:DataValues>
</APIService:FieldData>
</APIService:TemplateReference>
</APIService:TemplateReferences>
<APIService:Recipients>
<APIService:Recipient>
<APIService:ID>1</APIService:ID>
<APIService:UserName>John Smith</APIService:UserName>
<APIService:Email>johnSmith#mail.com</APIService:Email>
<APIService:Type>Signer</APIService:Type>
<APIService:CaptiveInfo>
<APIService:ClientUserId>1</APIService:ClientUserId>
</APIService:CaptiveInfo>
<APIService:RoutingOrder>1</APIService:RoutingOrder>
<APIService:RoleName>Signer</APIService:RoleName>
</APIService:Recipient>
</APIService:Recipients>
<APIService:EnvelopeInformation>
<APIService:AccountId>e3900d9b-1075-4d95-9d77-aecaddc38467</APIService:AccountId>
<APIService:EmailBlurb>This is my new eSignature service,it allows me to get your signoff without having to fax, scan, retype, refile and wait forever</APIService:EmailBlurb>
<APIService:Subject>Please Sign this NDA: John Smith</APIService:Subject>
</APIService:EnvelopeInformation>
<APIService:ActivateEnvelope>true</APIService:ActivateEnvelope>
</APIService:CreateEnvelopeFromTemplates>
</soap:Body>
</soap:Envelope>
2013-08-03 21:24:12.108 DocuSignFramework-ObjC[2809:c07] ResponseStatus: 200
2013-08-03 21:24:12.108 DocuSignFramework-ObjC[2809:c07] ResponseHeaders:
{
"Cache-Control" = "private, max-age=0";
"Content-Length" = 4108;
"Content-Type" = "application/soap+xml; charset=utf-8";
Date = "Sat, 03 Aug 2013 15:57:31 GMT";
"Strict-Transport-Security" = "max-age=7776000; includeSubDomains";
}
2013-08-03 21:24:12.109 DocuSignFramework-ObjC[2809:c07] ResponseBody:
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><env:Header xmlns:env="http://www.w3.org/2003/05/soap-envelope"><wsa:Action>http://www.docusign.net/API/3.0/CreateEnvelopeFromTemplatesResponse</wsa:Action><wsa:MessageID>urn:uuid:0689b7a8-2206-44a2-a465-1cd448367289</wsa:MessageID><wsa:RelatesTo>urn:uuid:aba49813-2326-4f82-8b2b-9ff361c2ddbc</wsa:RelatesTo><wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To><wsse:Security><wsu:Timestamp wsu:Id="Timestamp-3a57d1aa-53f7-489b-b442-85494b711036"><wsu:Created>2013-08-03T15:57:32Z</wsu:Created><wsu:Expires>2013-08-03T16:02:32Z</wsu:Expires></wsu:Timestamp></wsse:Security></env:Header><soap:Body><CreateEnvelopeFromTemplatesResponse xmlns="http://www.docusign.net/API/3.0"><CreateEnvelopeFromTemplatesResult><RecipientStatuses><RecipientStatus><Type>Signer</Type><Email>johnSmith#mail.com</Email><UserName>John Smith</UserName><RoutingOrder>1</RoutingOrder><Sent>2013-08-03T08:57:31.883</Sent><DeclineReason xsi:nil="true" /><Status>Sent</Status><RecipientIPAddress /><ClientUserId>1</ClientUserId><CustomFields /><TabStatuses><TabStatus><TabType>FullName</TabType><Status>Active</Status><XPosition>558</XPosition><YPosition>250</YPosition><TabLabel>Full Name 1</TabLabel><TabName>FullName</TabName><TabValue /></TabStatus><TabStatus><TabType>Custom</TabType><Status>Active</Status><XPosition>556</XPosition><YPosition>281</YPosition><TabLabel>Company 3</TabLabel><TabName>Company</TabName><TabValue>MyCompany</TabValue></TabStatus><TabStatus><TabType>Custom</TabType><Status>Active</Status><XPosition>558</XPosition><YPosition>320</YPosition><TabLabel>Data Field 5</TabLabel><TabName>Location</TabName><TabValue>Seattle</TabValue></TabStatus><TabStatus><TabType>DateSigned</TabType><Status>Active</Status><XPosition>556</XPosition><YPosition>362</YPosition><TabLabel>Date Signed 7</TabLabel><TabName>DateSigned</TabName><TabValue /></TabStatus><TabStatus><TabType>SignHere</TabType><Status>Active</Status><XPosition>375</XPosition><YPosition>1279</YPosition><TabLabel>Sign Here 6</TabLabel><TabName>SignHere</TabName><TabValue /></TabStatus><TabStatus><TabType>DateSigned</TabType><Status>Active</Status><XPosition>275</XPosition><YPosition>1435</YPosition><TabLabel>Date Signed 7</TabLabel><TabName>DateSigned</TabName><TabValue /></TabStatus></TabStatuses></RecipientStatus></RecipientStatuses><TimeGenerated>2013-08-03T08:57:32.1314114</TimeGenerated><EnvelopeID>536d4826-0797-47de-b502-daa02e6191de</EnvelopeID><Subject>Please Sign this NDA: John Smith</Subject><UserName>Nikhilesh Dubey</UserName><Email>dubeynikhileshs#gmail.com</Email><Status>Sent</Status><Created>2013-08-03T08:57:31.68</Created><Sent>2013-08-03T08:57:31.9130072</Sent><ACStatus>Original</ACStatus><ACStatusDate>2013-08-03T08:57:31.68</ACStatusDate><ACHolder>Nikhilesh Dubey</ACHolder><ACHolderEmail>dubeynikhileshs#gmail.com</ACHolderEmail><ACHolderLocation>DocuSign</ACHolderLocation><SigningLocation>Online</SigningLocation><SenderIPAddress>120.61.122.206 </SenderIPAddress><EnvelopePDFHash /><CustomFields><CustomField><Name>Envelope Field 1</Name><Show>False</Show><Required>False</Required><Value /></CustomField><CustomField><Name>Envelope Field 2</Name><Show>False</Show><Required>False</Required><Value /></CustomField><CustomField><Name>SendingAppVersion</Name><Show>False</Show><Required>False</Required><Value>Version=7.5.7600.16385 (win7_rtm.090713-1255);AppExe=w3wp.exe</Value></CustomField></CustomFields><AutoNavigation>true</AutoNavigation><EnvelopeIdStamping>true</EnvelopeIdStamping><AuthoritativeCopy>false</AuthoritativeCopy></CreateEnvelopeFromTemplatesResult></CreateEnvelopeFromTemplatesResponse></soap:Body></soap:Envelope>
2013-08-03 21:24:13.439 DocuSignFramework-ObjC[2809:c07] respone <APIServiceSoap12BindingResponse: 0x7c87190>
bodyParts (
"<APIService_CreateEnvelopeFromTemplatesResponse: 0x7b7bcb0>"
)
2013-08-03 21:24:13.440 DocuSignFramework-ObjC[2809:c07] response.CreateEnvelopeFromTemplatesResult.EnvelopeID 536d4826-0797-47de-b502-daa02e6191de
**RequestRecipientToken**
2013-08-03 21:24:13.442 DocuSignFramework-ObjC[2809:c07] OutputHeaders:
{
"Content-Length" = 1773;
"Content-Type" = "application/soap+xml; charset=utf-8";
Host = "demo.docusign.net";
SOAPAction = "http://www.docusign.net/API/3.0/RequestRecipientToken";
"User-Agent" = wsdl2objc;
"X-DocuSign-Authentication" = "<DocuSignCredentials><Username>dubeynikhileshs#gmail.com</Username><Password>myPassword</Password><IntegratorKey>XORI-84155a30-597a-4821-918a-40551d71dcff</IntegratorKey></DocuSignCredentials>";
}
2013-08-03 21:24:13.443 DocuSignFramework-ObjC[2809:c07] OutputBody:
<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:APIService="http://www.docusign.net/API/3.0" xsl:version="1.0">
<soap:Body>
<APIService:RequestRecipientToken>
<APIService:EnvelopeID>536d4826-0797-47de-b502-daa02e6191de</APIService:EnvelopeID>
<APIService:ClientUserID>1</APIService:ClientUserID>
<APIService:Username>John Smith</APIService:Username>
<APIService:Email>johnSmith#mail.com</APIService:Email>
<APIService:AuthenticationAssertion>
<APIService:AssertionID>Your AssertionID Here</APIService:AssertionID>
<APIService:AuthenticationInstant>2013-08-03T15:54:13Z</APIService:AuthenticationInstant>
<APIService:AuthenticationMethod>Password</APIService:AuthenticationMethod>
<APIService:SecurityDomain>YourApp.com</APIService:SecurityDomain>
</APIService:AuthenticationAssertion>
<APIService:ClientURLs>
<APIService:OnSigningComplete>http://www.google.com</APIService:OnSigningComplete>
<APIService:OnViewingComplete>http://www.google.com</APIService:OnViewingComplete>
<APIService:OnCancel>http://www.google.com</APIService:OnCancel>
<APIService:OnDecline>http://www.google.com</APIService:OnDecline>
<APIService:OnSessionTimeout>http://www.google.com</APIService:OnSessionTimeout>
<APIService:OnException>http://www.google.com</APIService:OnException>
<APIService:OnIdCheckFailed>http://www.google.com</APIService:OnIdCheckFailed>
</APIService:ClientURLs>
</APIService:RequestRecipientToken>
</soap:Body>
</soap:Envelope>
2013-08-03 21:24:16.003 DocuSignFramework-ObjC[2809:c07] ResponseStatus: 500
2013-08-03 21:24:16.003 DocuSignFramework-ObjC[2809:c07] ResponseHeaders:
{
"Cache-Control" = private;
"Content-Length" = 1475;
"Content-Type" = "application/soap+xml; charset=utf-8";
Date = "Sat, 03 Aug 2013 15:57:38 GMT";
"Strict-Transport-Security" = "max-age=7776000; includeSubDomains";
}
2013-08-03 21:24:16.004 DocuSignFramework-ObjC[2809:c07] ResponseBody:
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><env:Header xmlns:env="http://www.w3.org/2003/05/soap-envelope"><wsa:Action>http://schemas.xmlsoap.org/ws/2004/08/addressing/fault</wsa:Action><wsa:MessageID>urn:uuid:1688ead3-d6c4-4fff-9e41-8732160db9ce</wsa:MessageID><wsa:RelatesTo>urn:uuid:c5fe47b4-fc7f-47a3-855b-0b2d6435bd32</wsa:RelatesTo><wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To><wsse:Security><wsu:Timestamp wsu:Id="Timestamp-ff87b1c1-2ce2-43e6-8ccb-99e71bb2f8ac"><wsu:Created>2013-08-03T15:57:38Z</wsu:Created><wsu:Expires>2013-08-03T16:02:38Z</wsu:Expires></wsu:Timestamp></wsse:Security></env:Header><soap:Body><soap:Fault><soap:Code><soap:Value>soap:Receiver</soap:Value></soap:Code><soap:Reason><soap:Text xml:lang="en">Unspecified_Error</soap:Text></soap:Reason><soap:Node>https://demo.docusign.net/api/3.0/dsapi.asmx</soap:Node><detail><ErrorCode xmlns="missing in Web.Config">1</ErrorCode><ErrorReason xmlns="missing in Web.Config">An Error Occurred.</ErrorReason></detail></soap:Fault></soap:Body></soap:Envelope>
namespace error : xmlns: 'missing in Web.Config' is not a valid URI
t/api/3.0/dsapi.asmx</soap:Node><detail><ErrorCode xmlns="missing in Web.Config"
^
namespace error : xmlns: 'missing in Web.Config' is not a valid URI
="missing in Web.Config">1</ErrorCode><ErrorReason xmlns="missing in Web.Config"
I'm wondering if the error is due to the fact that you are saving your envelope as a draft envelope instead of sending it. Since you are using the
CreateEnvelopeFromTemplate()
api call, if it successfully completes then the end result should be an envelope that is saved as a draft and not sent yet (you can confirm by looking in your draft folder in the DocuSign Console). To request a recipient token the envelope needs to be sent, otherwise you'd want to request a sender token instead. Try calling
SendEnvelope()
after your CreateEnvelopeFromTemplate() call but before the RequestRecipientToken call.

WCF request with default empty tags

I'm trying to connect to a SOAP 1.1 webservice, using TLS.
The certificate has been set up right, and I am able to communicate with the webservice.
However, when I try to do this using a plain C# project, using proxyclasses generated by VS2010, the request seems to be incomplete, as in, the empty tags are not in the request. I then get a "This is an operation implementation generated fault" fault, viewable in Fiddler
If I then try to launch a request using SoapUI, I get a succesful response from the webservice.
I used Fiddler to compare both requests, and I noticed that the C# request was pretty plain, only sending elements that were filled in in my C# class.
But when I check the SoapUI request, this request included EVERY element defined in the WSDL/XSD's, even though they're empty.
I'm trying to understand how I can configure the C# client to include empty elements, to see if the webservice will accept my request, however I was unable to find such setting.
The C# request response:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode xmlns="">
SOAP-ENV:Server
</faultcode>
<faultstring xmlns="">
This is an operation implementation generated fault
</faultstring>
<faultactor xmlns=""/>
<detail xmlns="">
<ns:SOAPFault xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="urn:xxx:xxx:data:soapfault:1:standard" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<ns:ErrorCode>2.0</ns:ErrorCode>
<ns:ErrorText>XML schema validation error</ns:ErrorText>
<ns:ErrorDetails>
/{urn:xxx:xxx:service:contractcancellation:1:standard}ContractCancellationRequestEnvelope[1]/part1[1]/ContractCancellationRequestEnvelope[1]/BusinessDocumentHeader[1]/Destination[1]
</ns:ErrorDetails>
</ns:SOAPFault>
</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
The C# request:
POST xx HTTP/1.1
Content-Type: text/xml; charset=utf-8
SOAPAction: "urn:ContractCancellationRequestEnvelope"
Host: xx
Content-Length: 887
Expect: 100-continue
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ContractCancellationRequestEnvelope xmlns="urn:xxx:xxx:data:contractcancellationrequest:1:standard">
<Portaal_Content>
<Portaal_MeteringPoint>
<EANID>xxx</EANID>
<MPCommercialCharacteristics>
<ContractCancellationDate>
2013-11-15
</ContractCancellationDate>
</MPCommercialCharacteristics>
<Portaal_Mutation>
<Initiator>xxx</Initiator>
<Dossier>
<ID>TST0000001</ID>
</Dossier>
</Portaal_Mutation>
</Portaal_MeteringPoint>
</Portaal_Content>
</ContractCancellationRequestEnvelope>
</s:Body>
</s:Envelope>
The SoapUI request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:xxx:xxx:data:contractcancellationrequest:1:standard">
<soapenv:Header/>
<soapenv:Body>
<urn:ContractCancellationRequestEnvelope>
<urn:BusinessDocumentHeader>
<!--Optional:-->
<urn:ContentHash>?</urn:ContentHash>
<!--Optional:-->
<urn:ConversationID>?</urn:ConversationID>
<!--Optional:-->
<urn:CorrelationID>?</urn:CorrelationID>
<urn:CreationTimestamp>?</urn:CreationTimestamp>
<!--Optional:-->
<urn:DocumentID>?</urn:DocumentID>
<!--Optional:-->
<urn:ExpiresAt>?</urn:ExpiresAt>
<urn:MessageID>?</urn:MessageID>
<!--Optional:-->
<urn:ProcessTypeID>?</urn:ProcessTypeID>
<!--Optional:-->
<urn:RepeatedRequest>?</urn:RepeatedRequest>
<!--Optional:-->
<urn:TestRequest>?</urn:TestRequest>
<urn:Destination>
<urn:Receiver>
<!--Optional:-->
<urn:Authority>?</urn:Authority>
<!--Optional:-->
<urn:ContactTypeIdentifier>?</urn:ContactTypeIdentifier>
<urn:ReceiverID>?</urn:ReceiverID>
</urn:Receiver>
<!--Optional:-->
<urn:Service>
<!--Optional:-->
<urn:ServiceMethod>?</urn:ServiceMethod>
<!--Optional:-->
<urn:ServiceName>?</urn:ServiceName>
</urn:Service>
</urn:Destination>
<!--Optional:-->
<urn:Manifest>
<urn:NumberofItems>?</urn:NumberofItems>
<!--1 or more repetitions:-->
<urn:ManifestItem>
<!--Optional:-->
<urn:Description>?</urn:Description>
<!--Optional:-->
<urn:LanguageCode>?</urn:LanguageCode>
<urn:MimeTypeQualifierCode>?</urn:MimeTypeQualifierCode>
<urn:UniformResourceIdentifier>?</urn:UniformResourceIdentifier>
</urn:ManifestItem>
</urn:Manifest>
<urn:Source>
<!--Optional:-->
<urn:Authority>?</urn:Authority>
<!--Optional:-->
<urn:ContactTypeIdentifier>?</urn:ContactTypeIdentifier>
<urn:SenderID>?</urn:SenderID>
</urn:Source>
</urn:BusinessDocumentHeader>
<urn:Portaal_Content>
<urn:Portaal_MeteringPoint>
<urn:EANID>?</urn:EANID>
<urn:MPCommercialCharacteristics>
<urn:ContractCancellationDate>?</urn:ContractCancellationDate>
</urn:MPCommercialCharacteristics>
<urn:Portaal_Mutation>
<!--Optional:-->
<urn:ExternalReference>?</urn:ExternalReference>
<urn:Initiator>?</urn:Initiator>
<!--Optional:-->
<urn:Dossier>
<urn:ID>?</urn:ID>
</urn:Dossier>
</urn:Portaal_Mutation>
</urn:Portaal_MeteringPoint>
</urn:Portaal_Content>
</urn:ContractCancellationRequestEnvelope>
</soapenv:Body>
</soapenv:Envelope>
As you can see, the SoapUI request is far more complete, even though the elements are empty.
C# code (important parts):
_binding = new BasicHttpBinding(BasicHttpSecurityMode.Transport);
_binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate;
_endpoint = new EndpointAddress(endpointAddress + "xxx");
_proxy = new ContractCancellationPortTypeClient(_binding, _endpoint);
_proxy.ClientCredentials.ClientCertificate.SetCertificate(
StoreLocation.LocalMachine,
StoreName.My,
X509FindType.FindBySubjectName,
"xxx");
_proxy.ContractCancellation(new ContractCancellationRequestEnvelope()
{ Portaal_Content = new ContractCancellationRequestEnvelope_PC()
{ Portaal_MeteringPoint = new ContractCancellationRequestEnvelope_PC_PMP()
{ EANID = request.EanId,
MPCommercialCharacteristics = new ContractCancellationRequestEnvelope_PC_PMP_MPCC()
{ ContractCancellationDate = request.ContractCancellationDate },
Portaal_Mutation = new ContractCancellationRequestEnvelope_PC_PMP_PM()
{ Initiator = request.SupplierEanId,
Dossier = new ContractCancellationRequestEnvelope_PC_PMP_PM_Dossier()
{ ID = "TST0000001" }
}
}
});
In your code, you're generating the Portaal_Content portion of the ContractCancellationRequestEnvelope, but not the BusinessDocumentHeader portion.
If you look at the fault received (via C#) I'm betting that there's one or more required elements in the BusinessDocumentHeader section that are missing:
The error text is XML schema validation error, and the error detail is:
ContractCancellationRequestEnvelope[1]/part1[1]/ContractCancellationRequestEnvelope[1]/BusinessDocumentHeader[1]/Destination[1]
You need to ensure that all required elements are present in your SOAP message.
EDIT
Something like this should do the trick:
ContractCancellationRequestEnvelope reqMsg = new ContractCancellationRequestEnvelope();
reqMsg.BusinessDocumentHeader = new BusinessDocumentHeader()
{ CorrelationTimestamp = "?",
MessageID = "?" };
reqMsg.BusinessDocumentHeader.Destination = new Destination();
reqMsg.BusinessDocumentHeader.Receiver = new Receiver()
{ ReceiverID = "?" };
And so on. Basically, make sure that you create every element that is required.
By the way, you can do nested automatic initialization (as in the code you posted), I simply took a more explicit route in my example for readability.
The service's WSDL will tell you what is required or optional.
If you need more help either provide the URL for the service or post the WSDL.

How to hold Soap sessionid when calling another method in Objective-C

I'm trying to do some calls to webservices, but when I change the method the sessionId is different from the last method called. So I want to hold the session. I've tried many ways with no result. I am almost sure that I have to pass the session in SoapHeader method, like this:
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://xxx">
<soap:Header>
<SessionHeader xmlns='http://xxx'>
<sessionId>jsessionid=ABCDEFGHI:-1</sessionId>
</SessionHeader>
</soap:Header>
With no Result...
<?xml version="1.0"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header/>
<soapenv:Body>
<p118:method1:p118="http://xxx">
In the second method, the sessionId is a new session:
<?xml version="1.0"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header/>
<soapenv:Body>
<p118:method2 xmlns:p118="http://xxx">
How can i do this? Thank you very much!

PayPal API using SOAP

I need to use the PayPal API, using SOAP, to get our PayPal balance.
I've got as far as making a request using this XML:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >
<SOAP-ENV:Header>
<RequesterCredentials xmlns="urn:ebay:api:PayPalAPI" xsi:type="ebl:CustomSecurityHeaderType">
<Credentials xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:UserIdPasswordType">
<Username>[xxxxx]</Username>
<Password>[xxxxx]</Password>
<Signature>[xxxxx]</Signature>
<Subject>
</Subject>
</Credentials>
</RequesterCredentials>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<GetBalanceReq xsi:type="GetBalanceRequest">
<GetBalanceRequest xsi:type="GetBalanceRequestType">
<Version>83.0</Version>
<ReturnAllCurrencies>0</ReturnAllCurrencies>
</GetBalanceRequest>
</GetBalanceReq>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
...but I'm getting this response:
SOAP-ENV:ClientMethod 'GetBalanceReq' not implemented
Does my XML look ok..?
You can omit the optional parts in the "Credentials" header. Maybe you did not select the right endpoint (it seems getBalance is not available). The following SOAP request works with the latest sandbox WSDL :
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:ebay:api:PayPalAPI" xmlns:urn1="urn:ebay:apis:eBLBaseComponents">
<soapenv:Header>
<urn:RequesterCredentials>
<urn1:Credentials>
<urn1:Username>xxxx</urn1:Username>
<urn1:Password>xxxx</urn1:Password>
<urn1:Signature>xxxx</urn1:Signature>
</urn1:Credentials>
</urn:RequesterCredentials>
</soapenv:Header>
<soapenv:Body>
<urn:GetBalanceReq>
<urn:GetBalanceRequest>
<urn1:Version>83.0</urn1:Version>
<urn:ReturnAllCurrencies>0</urn:ReturnAllCurrencies>
</urn:GetBalanceRequest>
</urn:GetBalanceReq>
</soapenv:Body>
</soapenv:Envelope>
And the response:
<SOAP-ENV:Envelope "...">
<SOAP-ENV:Header>
"..."
</SOAP-ENV:Header>
<SOAP-ENV:Body id="_0">
<GetBalanceResponse xmlns="urn:ebay:api:PayPalAPI">
<Timestamp xmlns="urn:ebay:apis:eBLBaseComponents">2011-10-20T17:27:54Z</Timestamp>
<Ack xmlns="urn:ebay:apis:eBLBaseComponents">Success</Ack>
<CorrelationID xmlns="urn:ebay:apis:eBLBaseComponents">e6bb1ac6861d7</CorrelationID>
<Version xmlns="urn:ebay:apis:eBLBaseComponents">83.0</Version>
<Build xmlns="urn:ebay:apis:eBLBaseComponents">2183220</Build>
<Balance xsi:type="cc:BasicAmountType" currencyID="USD">0.00</Balance>
<BalanceTimeStamp xsi:type="xs:dateTime">2011-10-20T17:27:54Z</BalanceTimeStamp>
</GetBalanceResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>