Yes, before you ask, I know I'm just supposed to use WSDL2Java, but I'm
just trying to get a feel for this first :-)

I'm calling a .NET service from Java.  The header I'm generating in AXIS
doesn't look like the header the .NET service wants, so it's failing
with "Unable to handle request without a valid action parameter".

The .NET service wants this in the HTTP header:

POST /objacctwebservices/Login.asmx HTTP/1.1
Host: mcaosappstest
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://xml.objacct.com/GetLoginKey";

Instead, my code does something like this:

Content-Type: application/soap+xml; charset=utf-8;
action="http://xml.objacct.com/GetLoginKey";

And doesn't have a "SOAPAction: " parameter.

Here's my nifty code:

        ServiceClient client = new ServiceClient();
                Options options = new Options();
                options.setTo(new EndpointReference(uri));
                options.setAction("http://xml.objacct.com/GetLoginKey";);
                client.setOptions(options);
                MessageContext msgctx = new MessageContext();
        
msgctx.setEnvelope(LoginKeyMsg.createLoginKeyMessage("MCAO", "admin",
"abc123"));
                OperationClient opClient =
client.createClient(ServiceClient.ANON_OUT_IN_OP);
                opClient.addMessageContext(msgctx);
                opClient.execute(true);
                MessageContext respMsgCtx =
opClient.getMessageContext("In");
                SOAPEnvelope respEnvelope = respMsgCtx.getEnvelope();





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to