Note: forwarded message attached.
--- Begin Message ---
Could someone help me in setting explicit headers. I have tried everything. I
have not been successful. Please see my
XSD file that is referenced from my WSDL and the JAVA client that makes use
of WSDL2JAVA utility. This header is not a SOAP
header. Instead, it is a XML schema complex-type with in a complex-type. I
need to know how I can set the values of
complex-type within complex-type. I did set 'ID' and 'status' values. I
was not able to set the header
values ('entry' and 'input'). I appreciate your help. Please see the
followings:
THE XSD USED BY WSDL:
--------------------------------------------
<schema attributeFormDefault="unqualified"
elementFormDefault="qualified"
targetNamespace="http://xmlns.oracle.com/MCMS_Gateway"
xmlns="http://www.w3.org/2001/XMLSchema">
<element name="MCMS_GatewayProcessRequest">
<complexType>
<sequence>
<element name="ID" type="string" minOccurs="0"/>
<element name="status" type="string" minOccurs="0" />
<element name="header" minOccurs="0" maxOccurs="unbounded">
<complexType>
<sequence>
<element name="entry" type="string"/>
<element name="input" type="string"/>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
</element>
<element name="MCMS_GatewayProcessResponse">
<complexType>
<sequence>
<element name="result" type="string"/>
</sequence>
</complexType>
</element>
<element name="FaultMessage">
<complexType>
<sequence>
<element name="ID" type="string" />
<element name="status" type="string" />
</sequence>
</complexType>
</element>
</schema>
THE JAVA CLIENT CREATED THAT MAKES USE OF XSD STUBS:
-----------------------------------------------------------------------------------------------------
package com.oracle.xmlns.MCMS_Gateway;
import com.oracle.xmlns.MCMS_Gateway.MCMS_GatewayProcessRequest;
import com.oracle.xmlns.MCMS_Gateway.MCMS_GatewayProcessRequestHeader;
import com.oracle.xmlns.MCMS_Gateway.MCMS_Gateway_Service;
import com.oracle.xmlns.MCMS_Gateway.MCMS_GatewayBindingStub;
import com.oracle.xmlns.MCMS_Gateway.MCMS_GatewayProcessResponse;
import com.oracle.xmlns.MCMS_Gateway.MCMS_Gateway_ServiceLocator;
import com.oracle.xmlns.MCMS_Gateway.FaultMessage;
import java.net.URL;
public class Consume_MCMS_Gateway
{
public static void main(String [] args) throws Exception
{
System.out.println("Args:"+ args.length);
if (args.length == 4)
{
System.out.println("Args:"+ args.length);
Consume_MCMS_Gateway client = new Consume_MCMS_Gateway();
client.initiate(args);
}
}
public void initiate(String [] args) throws Exception
{
String ID = null;
String Status = null;
//MCMS_GatewayProcessRequestHeader
String Entry = null;
String Input = null;
ID = args[0];
Status = args[1];
Entry = args[2];
Input = args[3];
MCMS_GatewayProcessRequest req = new
MCMS_GatewayProcessRequest();
URL myurl = new URL("MY URL IS NOT DISPLAYED.");
MCMS_Gateway_Service service = new
MCMS_Gateway_ServiceLocator();
req.setID(args[0]);
req.setStatus(args[1]);
//Setting the Header Value
MCMS_GatewayProcessRequestHeader[] reqhdr = new
MCMS_GatewayProcessRequestHeader[1];
reqhdr[0] = new MCMS_GatewayProcessRequestHeader();
reqhdr[0].setEntry(Entry);
reqhdr[0].setInput(Input);
req.setHeader(0, reqhdr[0]);//Get Null Pointer Exception on
this line!
FaultMessage fault_msg = new FaultMessage();
// Now use the service to get a stub which implements the SDI.
MCMS_GatewayBindingStub stub = new
MCMS_GatewayBindingStub(myurl,service);
try
{
MCMS_GatewayProcessResponse resp = stub.process(req);
if (resp.getResult() != null)
{
System.out.println("Result: " + resp.getResult());
}
}
catch(FaultMessage e)
{
System.out.println("Exception: " + e.getID() + ": " +
e.getStatus());
}
}
}
--- End Message ---
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]