How to invoke this webservice method? - web-services

I can't wrap my mind around invoking a simple method of 3rd-party service. Here's the chunk of WSDL for this method:
<s:element name="PushRequest">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="LocationCode" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="PushRequestXml" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="PassPhrase" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>
This is a sample SOAP 1.1 request, generated by web-service:
<?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>
<PushRequest xmlns="http://xxxx.yyyy.com/">
<LocationCode>string</LocationCode>
<PushRequestXml>string</PushRequestXml>
<PassPhrase>string</PassPhrase>
</PushRequest>
</soap:Body>
</soap:Envelope>
First I thought that this is one argument of complex type, so I've tried this:
ws = CreateObject("webservice", serviceURL);
push = {};
push["LocationCode"] = "xxx";
push["PushRequestXml"] = "yyy";
push["PassPhrase"] = "zzz";
responseXML = ws.PushRequest(push);
But got usual CF response Web service operation PushRequest with parameters {{PushRequestXml={yyy},LocationCode={xxx},PassPhrase={zzz}}} cannot be found..
Next I thought that maybe this is not a complex argument (at least it doesn't have a name attribute in XML), but three different arguments:
ws = CreateObject("webservice", serviceURL);
responseXML = ws.PushRequest(LocationCode = "xxx", PushRequestXml = "yyy", PassPhrase = "zzz");
Result is the same: Web service operation PushRequest with parameters {PushRequestXml={{PushRequestXml, yyy}},LocationCode={{LocationCode, xxx}},PassPhrase={{PassPhrase, zzz}}} cannot be found.
Any ideas how this should be handled? Please tell if more information needed.
I'm using ACF9, webservice is provided by ASP.net
Thanks.

I've ended up with using plain POST-ing raw XML to the web-service and parsing response XML manually, as proposed in this blog post.
Also I've tried wsdl2java as proposed in 3rd part of that blog series, but it did not help me -- method looked exactly as expected previously:
public java.lang.String pushRequest(java.lang.String locationCode, java.lang.String pushRequestXml, java.lang.String passPhrase) throws java.rmi.RemoteException;
As a result, I haven't found the applicable way for use cfinvoke for my webservice.
So, my current request code looks as follows:
<cfsavecontent variable="SOAPXML">
<cfoutput>
<?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>
<PushRequest xmlns="http://serviceurl.com/">
<LocationCode>#LocationCode#</LocationCode>
<PushRequestXml>#XMLFormat(Trim(PushRequestXml))#</PushRequestXml>
<PassPhrase>#PassPhrase#</PassPhrase>
</PushRequest>
</soap:Body>
</soap:Envelope>
</cfoutput>
</cfsavecontent>
<cfhttp method="post" url="#ServiceURL#">
<cfhttpparam type="header" name="SOAPAction" value="http://serviceurl.com/PushRequest" />
<cfhttpparam type="xml" value="#Trim(SOAPXML)#" />
</cfhttp>
Service returns XML, so handling it is not a problem.

Have u tried using CFBuilder, and paste in the serviceURL into Services Browser (Show Web Services -> +), and then right click that to generate the correct createObject() call?

I'm no guru on WSDL, but I seem to remember that auto generated WSDL's usually suffix the method with either 'Request' or 'Response', so you may need to simply call 'Push' rather than 'PushRequest'.
ws = CreateObject("webservice", serviceURL);
push = {};
push["LocationCode"] = "xxx";
push["PushRequestXml"] = "yyy";
push["PassPhrase"] = "zzz";
responseXML = ws.Push(push);
worth a shot.

Related

How to remove soap envelope in wso2 esb

I am using wso2esb 4.8.0,I am trying to connect my legacy systems which can accept rest calls with post method.
I am sending the same to them but soap envelope is adding by wso2 .
current message :
<?xml version='1.0' encoding='UTF-8'?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.comapny.org/" xmlns:env="http://com.comany.inn/Envelope"><soap:Header xmlns:p="http://webservices.usedin.com/PService">
</soap:Header><soap:Body>
<requested id="12345">
<authen login="username" password="password">
<parm name="COMPANY" value="myname"/>
</authen>
<actionReq production="doctor" id="1234" type="TINGS">
<parm name="name" value="12345"/>
</actionReq>
</requested>
</soap:Body></soap:Envelope>
Expected one:
<requested id="12345">
<authen login="username" password="password">
<parm name="COMPANY" value="myname"/>
</authen>
<actionReq production="doctor" id="1234" type="TINGS">
<parm name="name" value="12345"/>
</actionReq>
</requested>
Since this rest cal i can't use format also "format=pox" like in soap services.
my code is like this.
</xquery>
<send>
<http uri-template="http://******/webservices/***.php" method="post">
</send>
Do I need to add any property to remove soap envelope for esb out request.
Try to add this property before send mediator :
<property name="messageType" value="application/xml" scope="axis2"/>

Docusign and ColdFusion integration

I am using the following code to call the docusign api. I got the information from this link.
<soap:Body>
<ns:CreateEnvelopeFromTemplates>
<ns:TemplateReferences>
<ns:TemplateReference>
<ns:TemplateLocation>Server</ns:TemplateLocation>
<ns:Template>XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX</ns:Template>
<ns:RoleAssignments>
<ns:RoleAssignment>
<ns:RoleName>Company</ns:RoleName>
<ns:RecipientID>1</ns:RecipientID>
</ns:RoleAssignment>
</ns:RoleAssignments>
</ns:TemplateReference>
</ns:TemplateReferences>
<ns:Recipients>
<ns:Recipient>
<ns:ID>1</ns:ID>
<ns:UserName>Fred Flintstone</ns:UserName>
<ns:Email>fred.flintstone#...</ns:Email>
<ns:Type>Signer</ns:Type>
<ns:RoleName>Caveman</ns:RoleName>
<ns:RoutingOrder>1</ns:RoutingOrder>
</ns:Recipient>
</ns:Recipients>
<ns:EnvelopeInformation>
<ns:AccountId>XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX</ns:AccountId>
<ns:EmailBlurb>This Envelope was sent through the DocuSign API using ColdFusion</ns:EmailBlurb>
<ns:Subject>DocuSign it! using ColdFusion</ns:Subject>
</ns:EnvelopeInformation>
<ns:ActivateEnvelope>true</ns:ActivateEnvelope>
</ns:CreateEnvelopeFromTemplates>
</soap:Body>
I am unable to understand what the RoleAssignment tag under Template is used for. I have gone through the documentation here but did not understand it.
I think this is the only reason I am not getting a response. I commented this portion in my code but I am getting the following output after changing all of the credentials.
An error occurred!
struct
Charset [empty string]
ErrorDetail Unknown host: demo.docusign.net
Filecontent Connection Failure
Header [empty string]
Mimetype Unable to determine MIME type of file.
Responseheader
struct [empty]
Statuscode Connection Failure. Status code unavailable.
Text YES
Can anyone please help me out with this?
I don't think the RoleAssignment has anything to do with that particular error. You need to combine the SOAP Header and the SOAP Body from their example. The SOAP Body should be contained with the SOAP Header block.
Notice that their example for the SOAP Header contains the <soap:Body> block. Then their example for the SOAP Body is also surrounded by the <soap:Body> block. They should be combined like this for your <cfhttp> call:
<cfset UserName = "[XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX]XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX" />
<cfset Password = "SuperSecret" />
<cfscript>
strNonce = ToBase64(createUUID());
</cfscript>
<!--- create the request body XML block --->
<cfsavecontent variable="request_xml">
<cfoutput>
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:ns="http://www.docusign.net/API/3.0">
<soap:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-1" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:Username>#UserName#</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0##PasswordText">#Password#</wsse:Password>
<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0##Base64Binary">#strNonce#</wsse:Nonce>
</wsse:UsernameToken>
</wsse:Security>
</soap:Header>
<soap:Body>
<ns:CreateEnvelopeFromTemplates>
<ns:TemplateReferences>
<ns:TemplateReference>
<ns:TemplateLocation>Server</ns:TemplateLocation>
<ns:Template>XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX</ns:Template>
<ns:RoleAssignments>
<ns:RoleAssignment>
<ns:RoleName>Company</ns:RoleName>
<ns:RecipientID>1</ns:RecipientID>
</ns:RoleAssignment>
</ns:RoleAssignments>
</ns:TemplateReference>
</ns:TemplateReferences>
<ns:Recipients>
<ns:Recipient>
<ns:ID>1</ns:ID>
<ns:UserName>Fred Flintstone</ns:UserName>
<ns:Email>fred.flintstone#...</ns:Email>
<ns:Type>Signer</ns:Type>
<ns:RoleName>Caveman</ns:RoleName>
<ns:RoutingOrder>1</ns:RoutingOrder>
</ns:Recipient>
</ns:Recipients>
<ns:EnvelopeInformation>
<ns:AccountId>XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX</ns:AccountId>
<ns:EmailBlurb>This Envelope was sent through the DocuSign API using ColdFusion</ns:EmailBlurb>
<ns:Subject>DocuSign it! using ColdFusion</ns:Subject>
</ns:EnvelopeInformation>
<ns:ActivateEnvelope>true</ns:ActivateEnvelope>
</ns:CreateEnvelopeFromTemplates>
</soap:Body>
</soap:Envelope>
</cfoutput>
</cfsavecontent>
(This example was taken directly from their documentation. I only combined the two blocks.)
Then send that request (from their example):
<!--- send the request to the DocuSign service --->
<cfhttp url="https://demo.docusign.net/api/3.0/api.asmx" method="post" result="http_response">
<!--- make sure you set this correctly for the call you are making --->
<cfhttpparam type="header" name="SOAPAction" value="http://www.docusign.net/API/3.0/CreateEnvelopeFromTemplates" />
<cfhttpparam type="header" name="accept-encoding" value="no-compression" />
<cfhttpparam type="xml" value="#trim(request_xml)#" />
</cfhttp>
And finally handle the response (from their example):
<!--- if we received a successful response --->
<cfif find("200", http_response.statusCode)>
<cfscript>
response_xml = xmlParse(http_response.fileContent);
// use XPath to get the top level element you want from the SOAP response
result_node = xmlSearch(response_xml, "//*[local-name() = 'CreateEnvelopeFromTemplatesResult']")[1];
// use dot notation to navigate the XML structure
envelope_id = result_node.EnvelopeID.xmlText;
</cfscript>
<cfoutput>
EnvelopeID: #envelope_id#
</cfoutput>
<cfelse>
<cfoutput>
An error occurred!
</cfoutput>
<cfdump var="#http_response#">
</cfif>
If this is a POST request (submitting data), it looks as though the webservice is not recognising the submission of the actual SOAP XML file.
Are you sending the XML as an XML type as shown in the documentation?
<cfhttpparam type="xml" value="#trim(request_xml)#" />
The RoleAssignment tags are used for assigning your recipient to a particular template role. When you send an envelope that uses a template, you are referencing a template that you have created through the DocuSign console (demo.docusign.net). When you created the template, you had to specify at least one template role for the template, which contains a role name, recipient name, and recipient email. The value you use for the role here needs to match the role name you provide in the api call. So if you called your role "Signer1" for instance, you need to have
<ns:RoleName>Signer1</ns:RoleName>
If you named the role "Company" the keep like you have it.

JAX WS xsd:any type is an XMLSchema element

Handling xsd:any type is an XMLSchema element JAX WS
<types>
<schema targetNamespace="http://www.iona.com/artix/wsdl"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<complexType name="unmappedType">
<sequence>
<xsd:any namespace="##other"
processContents="skip"/>
</sequence>
</complexType>
<element name="request" type="tns:requestType"/>
</schema>
</types>
The xml is there as a STring how to have it as a document object, and then transfer its contents into a SOAPElement instance
Need guidance for the implementation and client code.
Convertng the XML String into the Element. and also reading it back once the response is received .
I see that someone has downvoted your question... If you don't mind, I would first point out the issues your question seems to have: the snippet most likely comes from an WSDL, but the schema is rather invalid. The first thing you should do is to make it right. Maybe something like this:
<?xml version="1.0" encoding="utf-8"?>
<!--W3C Schema generated by QTAssistant/W3C Schema Refactoring Module (http://www.paschidev.com)-->
<schema targetNamespace="http://www.iona.com/artix/wsdl" xmlns:tns="http://www.iona.com/artix/wsdl" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<complexType name="unmappedType">
<sequence>
<any namespace="##other" processContents="skip"/>
</sequence>
</complexType>
<element name="request" type="tns:unmappedType"/>
</schema>
Once you've done it, I suggest making up an XML that looks the way you want; make sure you validate that. Post it along with your question...
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<!-- Sample XML generated by QTAssistant (http://www.paschidev.com) -->
<request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://www.iona.com/artix/wsdl">
<any_element xmlns="otherNS">anyType</any_element>
</request>
I would then use a tool that's free and easy to use when it comes to JAXB (I recommend NetBeans, it has a straightforward interface). Then write a small Java console app that uses your code; debug through, and see what you get when you unmarshall the XML. Maybe read a little bit the documentation, and then eventually post to ask for help with a more specific question.
The xsd:any and JAXB is pretty well documented: try this about JAXB...

Adding authorization to a third-party web service

I have several third-party web services of which I only have their WSDL's. Currently they are only accessible in my internal network. I would like to expose those web services to the internet but, since they read/write sensitive information, I would need some sort of authentication mechanism in order to assure that only certain users are able to invoke them.
The idea is to expose exactly the same interface (same operations with the same parameters) but intercepting each invocation to check the security and then invoking the original web service if the authentication is valid or returning an exception or error message otherwise. I've been trying to use Mule ESB for the task abut I can't quite get there
Is this possible with mule? If not, how would i go about doing this? Can anyone point me in the right direction?
Thanks in advance.
Here is an example of a web service proxy adding WS-Security to an unsecure target web service:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:mule-ss="http://www.mulesoft.org/schema/mule/spring-security"
xmlns:ss="http://www.springframework.org/schema/security"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.2/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/3.2/mule-http.xsd
http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/3.2/mule-cxf.xsd
http://www.mulesoft.org/schema/mule/spring-security http://www.mulesoft.org/schema/mule/spring-security/3.2/mule-spring-security.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd">
<mule-ss:security-manager>
<mule-ss:delegate-security-provider
name="memory-provider" delegate-ref="authenticationManager" />
</mule-ss:security-manager>
<spring:beans>
<ss:authentication-manager alias="authenticationManager">
<ss:authentication-provider>
<ss:user-service id="userService">
<ss:user name="user" password="pass" authorities="ROLE_USER" />
</ss:user-service>
</ss:authentication-provider>
</ss:authentication-manager>
<cxf:security-manager-callback id="serverCallback" />
</spring:beans>
<flow name="secureStockQuoteWsProxy">
<http:inbound-endpoint address="http://localhost:8080/sec-ws/stockquote"
exchange-pattern="request-response">
<cxf:proxy-service>
<cxf:inInterceptors>
<spring:bean
class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor" />
<spring:bean
class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
<spring:constructor-arg>
<spring:map>
<spring:entry key="action" value="UsernameToken" />
<spring:entry key="passwordCallbackRef"
value-ref="serverCallback" />
</spring:map>
</spring:constructor-arg>
</spring:bean>
</cxf:inInterceptors>
</cxf:proxy-service>
</http:inbound-endpoint>
<http:outbound-endpoint address="http://www.webservicex.net/stockquote.asmx"
exchange-pattern="request-response">
<cxf:proxy-client enableMuleSoapHeaders="false"
soapVersion="1.2" />
</http:outbound-endpoint>
</flow>
http://www.webservicex.net/stockquote.asmx?wsdl gives the same result. So you could test it there. Maybe the problem lies with .net services.
Anyway, for now I made a successful proxy with the webservice pattern. Now I am still working on transforming a response. Not with much success because Mule keeps giving me a ReleasingInputStream as response.

Client no longer getting data from Web Service after introducing targetNamespace in XSD

Sorry if there is way too much info in this post – there’s a load of story before I get to the actual problem. I thought I‘d include everything that might be relevant as I don’t have much clue what is wrong.
I had a working web service and client (both written with VS 2008 in C#) for passing product data to an e-commerce site. The XSD started like this:
<xs:schema id="Ecommerce"
elementFormDefault="qualified"
xmlns:mstns="http://tempuri.org/Ecommerce.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="eur">
<xs:complexType>
<xs:sequence>
<xs:element ref="sec" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
etc
Here’s a sample document sent from client to service:
<eur xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" class="ECommerce_WebService" type="product" method="GetLastDateSent" chunk_no="1" total_chunks="1" date_stamp="2010-03-10T17:16:34.523" version="1.1">
<sec guid="BFBACB3C-4C17-4786-ACCF-96BFDBF32DA5" company_name="Company" version="1.1">
<data />
</sec>
</eur>
Then, I had to give the service a targetNamespace. Actually I don’t know if I “had” to set it, but I added (to the same VS project) some code to act as a client to a completely unrelated service (which also had no namespace), and the project would not build until I gave my service a namespace.
Now the XSD starts like this:
<xs:schema id="Ecommerce"
elementFormDefault="qualified"
xmlns:mstns="http://tempuri.org/Ecommerce.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.company.com/ecommerce"
xmlns:ecom="http://www. company.com/ecommerce">
<xs:element name="eur">
<xs:complexType>
<xs:sequence>
<xs:element ref="ecom:sec" minOccurs="1" maxOccurs="1" />
</xs:sequence>
etc
As you can see above I also updated all the xs:element ref attributes to give them the “ecom” prefix. Now the project builds again.
I found the client needed some modification after this. The client uses a SQL stored procedure to generate the XML. This is then de-serialised into an object of the correct type for the service’s “get_data” method. The object’s type used to be “eur” but after updating the web reference to the service, it became “get_dataEur”. And sure enough the parent element in the XML had to be changed to “get_dataEur” to be accepted. Then bizarrely I also had to put the xmlns attribute containing my namespace on the “sec” element (the immediate child of the parent element) rather than the parent element. Here’s a sample document now sent from client to service:
<get_dataEur xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" class="ECommerce_WebService" type="product" method="GetLastDateSent" chunk_no="1" total_chunks="1" date_stamp="2010-03-10T18:23:20.653" version="1.1">
<sec xmlns="http://www.company.com/ecommerce" guid="BFBACB3C-4C17-4786-ACCF-96BFDBF32DA5" company_name="Company" version="1.1">
<data />
</sec>
</get_dataEur>
If in the service’s get_data method I then serialize the incoming object I see this (the parent element is “eur” and the xmlns attribute is on the parent element):
<eur xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.company.com/ecommerce" class="ECommerce_WebService" type="product" method="GetLastDateSent" chunk_no="1" total_chunks="1" date_stamp="2010-03-10T18:23:20.653" version="1.1">
<sec guid="BFBACB3C-4C17-4786-ACCF-96BFDBF32DA5" company_name="Company" version="1.1">
<data />
</sec>
</eur>
The service then prepares a reply to go back to the client. The XML looks like this (the important data being sent back is the date_stamp attribute in the last_sent element):
<eur xmlns="http://www.company.com/ecommerce" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" class="ECommerce_WebService" type="product" method="GetLastDateSent" chunk_no="1" total_chunks="1" date_stamp="2010-03-10T18:22:57.530" version="1.1">
<sec version="1.1" xmlns="">
<data>
<last_sent date_stamp="2010-02-25T15:15:10.193" />
</data>
</sec>
</eur>
Now finally, here’s the problem!!! The client does not see any data – all it sees is the parent element with nothing inside it. If I serialize the reply object in the client code it looks like this:
<get_dataResponseEur xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" class="ECommerce_WebService" type="product" method="GetLastDateSent" chunk_no="1" total_chunks="1" date_stamp="2010-03-10T18:22:57.53" version="1.1" />
So, my questions are:
why isn’t my client seeing the contents of the reply document?
how do I fix it?
why do I have to put the xmlns attribute on a child element rather than the parent element in the outgoing document?
Here’s a bit more possibly relevant info:
The client code (pre-namespace) called the service method like this:
XmlSerializer serializer = new XmlSerializer(typeof(eur));
XmlReader reader = xml.CreateReader();
eur eur = (eur)serializer.Deserialize(reader);
service.Credentials = new NetworkCredential(login, pwd);
service.Url = url;
rc = service.get_data(ref eur);
After the namespace was added I had to change it to this:
XmlSerializer serializer = new XmlSerializer(typeof(get_dataEur));
XmlReader reader = xml.CreateReader();
get_dataEur eur = (get_dataEur)serializer.Deserialize(reader);
get_dataResponseEur eur1 = new get_dataResponseEur();
service.Credentials = new NetworkCredential(login, pwd);
service.Url = url;
rc = service.get_data(eur, out eur1);
After the namespace was added I had to change it to this:
You don't seem to add any namespace here...... try adding the default namespace to the constructor of the XmlSerializer like this:
XmlSerializer serializer = new XmlSerializer(typeof(get_dataEur), "http://www.company.com/ecommerce"
);
XmlReader reader = xml.CreateReader();
get_dataEur eur = (get_dataEur)serializer.Deserialize(reader);
get_dataResponseEur eur1 = new get_dataResponseEur();
service.Credentials = new NetworkCredential(login, pwd);
service.Url = url;
rc = service.get_data(eur, out eur1);
Does that help??