Mike,
This wsdl indicates that it only sends a header, no body .. so the argument to the method should be automatically placed in the soap header. The message SendHL7HL7Header would have two parts if it was going to send both a header and body. I've never sent just a header .. always with a body .. if it doesn't work then its a bug.
Turn on SOAPMonitor or TCPMonitor and you can see where the argument is placed.
Tom Gordon
M Litherland wrote:
Tom,
Thanks for the reply. I'm attaching the WSDL here. My "send" method only accepts one argument, so I can't stick the header in there.
Thanks again, Mike
TMG wrote:
Mike,
Without seeing the wsdl, I can only speculate as to how it was implemented. That said, normally the first argument is the header object with the stub, and the generated code moves it to the proper place in the soap messages.
For example, using a stub: MyLocatorServiceLocator locator = new MyLocatorServiceLocator(); MyLocator service = locator.getMyLocator(); "Some Result Type" result = service."someMethod"(firstArg, secondArg);
The firstArg would be the header, and secondArg would be the body.
Tom Gordon
note: I could tell you exactly how it would work if you posted your wsdl.
M Litherland wrote:
Hi all,
I'm new to Axis and I am trying to create a SOAP client to communicate with a vendor. They have supplied me with the WSDL and I ran WSDL2Java against it to create my stubs. There are custom headers, so I specified the '-a' option for WSDL2Java to produce a stub for the custom header as well.
My problem is that I don't know what to do with this custom header. I can create the object and populate it as need be, but how do I tell my code to use that header? The code is very simple - essentially these three lines:
MySoapLocator msl = new MySoapLocator(); MySoap ms = msl.getMySoap(new java.net.URL(URL)); ms.send(message);
I would expect to be able to do something like this:
ms.setHeader(myHeaderObject);
Before I perform the send. I have a feeling I am just thinking about the problem in the wrong way. Is there anybody on the list willing to enlighten me?
Thanks a bunch, Mike
------------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?> <definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://contentsolutions.net/hl7services" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://contentsolutions.net/hl7services" xmlns="http://schemas.xmlsoap.org/wsdl/"> <types> <s:schema elementFormDefault="qualified" targetNamespace="http://contentsolutions.net/hl7services"> <s:element name="SendHL7"> <s:complexType> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="HL7" type="s:string" /> </s:sequence> </s:complexType> </s:element> <s:element name="SendHL7Response"> <s:complexType> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="SendHL7Result" type="s:string" /> </s:sequence> </s:complexType> </s:element> <s:element name="HL7Header" type="s0:HL7Header" /> <s:complexType name="HL7Header"> <s:sequence> <s:element minOccurs="1" maxOccurs="1" name="CustomerID" type="s:int" /> <s:element minOccurs="1" maxOccurs="1" name="DomainID" type="s:int" /> <s:element minOccurs="0" maxOccurs="1" name="LogonName" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="Password" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="DestinationSystemID" type="s:int" /> </s:sequence> </s:complexType> </s:schema> </types> <message name="SendHL7SoapIn"> <part name="parameters" element="s0:SendHL7" /> </message> <message name="SendHL7SoapOut"> <part name="parameters" element="s0:SendHL7Response" /> </message> <message name="SendHL7HL7Header"> <part name="HL7Header" element="s0:HL7Header" /> </message> <portType name="HL7SSLSoap"> <operation name="SendHL7"> <input message="s0:SendHL7SoapIn" /> <output message="s0:SendHL7SoapOut" /> </operation> </portType> <binding name="HL7SSLSoap" type="s0:HL7SSLSoap"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> <operation name="SendHL7"> <soap:operation soapAction="http://contentsolutions.net/hl7services/SendHL7" style="document" /> <input> <soap:body use="literal" /> <soap:header message="s0:SendHL7HL7Header" part="HL7Header" use="literal" /> </input> <output> <soap:body use="literal" /> </output> </operation> </binding> <service name="HL7SSL"> <port name="HL7SSLSoap" binding="s0:HL7SSLSoap"> <soap:address location="https://app1-csi.net/hl7web/hl7ssl.asmx" /> </port> </service> </definitions>