I hoping you guys can help me.
I am a .Net developer using C# code. I have been given the task to call a web service written in Java by my colleague. The first problem we have is he doesn’t speak .Net and I don’t speak Java.
The first question is whether to using a web reference or a service reference. Both seem to work in the sense that my program can find the service and add the reference. But the Service Reference is not exposed in my project. For this reason I went with the Web reference at least for now.
I can set any of the properties and recall them and it works fine. The question I have is how to invoke the method. When I ask my colleague he does not seem to get what I am talking about.
I need the answer if it’s something simply or if I need to ask a question my colleague in a way that a Java person will understand what I’m talking about.
Here is the code I have written:
WebReference.getContactUs myContactUs = new WebReference.getContactUs();
myContactUs.ContactUsReceived = DateTime.Now;
myContactUs.FirstName = "Bob";
myContactUs.LastName = "Avallone";
DateTime _ThisDateTime = myContactUs.ContactUsReceived;
Here is the code from the wsdl
<?xml version="1.0" encoding="utf-8"?>
<definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://contactus.nrcme.fmcsa.dot.gov/" xmlns:ns1="http://nrcme.fmcsa.dot.gov/ContactUs/" name="ContactUs" targetNamespace="http://nrcme.fmcsa.dot.gov/ContactUs/" xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<xs:schema targetNamespace="http://nrcme.fmcsa.dot.gov/ContactUs/" version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="getContactUs">
<xs:complexType>
<xs:sequence>
<xs:element name="ContactUsReceived" type="xs:dateTime" />
<xs:element name="FirstName" type="xs:string" />
<xs:element name="LastName" type="xs:string" />
<xs:element name="Title" type="xs:string" />
<xs:element name="Organization" type="xs:string" />
<xs:element name="Address1" type="xs:string" />
<xs:element name="Address2" type="xs:string" />
<xs:element name="City" type="xs:string" />
<xs:element name="State" type="xs:string" />
<xs:element name="ZipCode" type="xs:string" />
<xs:element name="Telephone" type="xs:string" />
<xs:element minOccurs="0" name="Fax" type="xs:string" />
<xs:element name="Email" type="xs:string" />
<xs:element name="EmailConfirm" type="xs:string" />
<xs:element minOccurs="0" name="Comment" type="xs:string" />
<xs:element minOccurs="0" name="Question1" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="getContactUsResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="ContactUsReceived" type="xs:dateTime" />
<xs:element minOccurs="0" name="status" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</types>
<message name="ContactUs_getContactUsResponse">
<part name="getContactUsResponse" element="ns1:getContactUsResponse" />
</message>
<message name="ContactUs_getContactUs">
<part name="getContactUs" element="ns1:getContactUs" />
</message>
<portType name="ContactUs">
<operation name="getContactUs" parameterOrder="getContactUs">
<input message="ns1:ContactUs_getContactUs" />
<output message="ns1:ContactUs_getContactUsResponse" />
</operation>
</portType>
<binding name="ContactUsBinding" type="ns1:ContactUs">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
<operation name="getContactUs">
<soap:operation soapAction="http://nrcme.fmcsa.dot.gov/ContactUs/getContactUs" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
</definitions>
Thanks in advance, this forum has been great.