Re: Axis2 generated wsdl soap address is 0.0.0.0

2007-11-01 Thread Daniel Herbison

There seems to be an extra interface card on the machine that is not
connected.  Is there a way in tomcat/axis to force it to use a specific card
or ip?



Sanka Samaranayke wrote:
 
 Hi Daniel, 
 
 Can you please check whether the IP of the machine on which you
 experiencing the problem is being set properly? 
 I think the problem must be that the IP of the network interface of that
 particular machine has been set to 0.0.0.0 where it is being picked by
 Axis2 WSDL generating mechanism when calculating service endpoint
 addresses.
 
 --Sanka
 
 
 Daniel Herbison wrote:
 Hi All! 
 I have a web service deployed on one machine under axis2 and i'm calling
 it
 using flex and everything is working great.  However when I place the
 service on another machine under axis2 i can no longer run the services
 from
 flex but they do run fine from the browser.  Flex is complaining about
 the
 soap:address being set to 0.0.0.0, see below.  Why is the WSDL being set
 to
 0.0.0.0 on one machine and on the other machine it is being set to the
 correct ip 

 - wsdl:service name=IEventService 
 - wsdl:port name=IEventServiceSOAP11port_http
 binding=axis2:IEventServiceSOAP11Binding 
   soap:address
 location=http://0.0.0.0:8086/axis2/services/IEventService;
 / 
   /wsdl:port 
 - wsdl:port name=IEventServiceSOAP12port_http
 binding=axis2:IEventServiceSOAP12Binding 
   soap12:address
 location=http://0.0.0.0:8086/axis2/services/IEventService; / 
   /wsdl:port 
 - wsdl:port name=IEventServiceHttpport
 binding=axis2:IEventServiceHttpBinding 
   http:address
 location=http://0.0.0.0:8086/axis2/services/IEventService;
 / 
   /wsdl:port 
   /wsdl:service
   
 
 
 -- 
 Sanka Samaranayake
 WSO2 Inc.
 
 http://www.bloglines.com/blog/sanka
 http://www.wso2.org/
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Axis2-generated-wsdl-soap-address-is-0.0.0.0-tf4713352.html#a13529395
Sent from the Axis - User mailing list archive at Nabble.com.


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



Axis2 generated wsdl soap address is 0.0.0.0

2007-10-29 Thread Daniel Herbison

Hi All! 
I have a web service deployed on one machine under axis2 and i'm calling it
using flex and everything is working great.  However when I place the
service on another machine under axis2 i can no longer run the services from
flex but they do run fine from the browser.  Flex is complaining about the
soap:address being set to 0.0.0.0, see below.  Why is the WSDL being set to
0.0.0.0 on one machine and on the other machine it is being set to the
correct ip 

- wsdl:service name=IEventService 
- wsdl:port name=IEventServiceSOAP11port_http
binding=axis2:IEventServiceSOAP11Binding 
  soap:address location=http://0.0.0.0:8086/axis2/services/IEventService;
/ 
  /wsdl:port 
- wsdl:port name=IEventServiceSOAP12port_http
binding=axis2:IEventServiceSOAP12Binding 
  soap12:address
location=http://0.0.0.0:8086/axis2/services/IEventService; / 
  /wsdl:port 
- wsdl:port name=IEventServiceHttpport
binding=axis2:IEventServiceHttpBinding 
  http:address location=http://0.0.0.0:8086/axis2/services/IEventService;
/ 
  /wsdl:port 
  /wsdl:service
-- 
View this message in context: 
http://www.nabble.com/Axis2-generated-wsdl-soap-address-is-0.0.0.0-tf4713352.html#a13472967
Sent from the Axis - User mailing list archive at Nabble.com.


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



Re: wsdl:service soap12:address set to 0.0.0.0, why?

2007-09-13 Thread Daniel Herbison

it is using ipv4 and with only 1 network card.


dims wrote:
 
 How many network cards does this new box have? is it using IPv6?
 
 thanks,
 dims
 
 On 9/12/07, Daniel Herbison [EMAIL PROTECTED] wrote:

 I have a service running under axis2, on one server, and it runs great
 but
 when I take the aar file and copy it to another server, to run under a
 different instance of axis2, I get this 0.0.0.0 soap address and the
 client
 I'm using doesn't like it!  Why?  The original server places the host ip
 in
 that position. Do I have axis2 or tomcat set up incorrectly?

 - wsdl:service name=IEventService
 - wsdl:port name=IEventServiceSOAP11port_http
 binding=axis2:IEventServiceSOAP11Binding
   soap:address
 location=http://0.0.0.0:8086/axis2/services/IEventService;
 /
   /wsdl:port
 - wsdl:port name=IEventServiceSOAP12port_http
 binding=axis2:IEventServiceSOAP12Binding
   soap12:address
 location=http://0.0.0.0:8086/axis2/services/IEventService; /
   /wsdl:port
 - wsdl:port name=IEventServiceHttpport
 binding=axis2:IEventServiceHttpBinding
   http:address
 location=http://0.0.0.0:8086/axis2/services/IEventService;
 /
   /wsdl:port
   /wsdl:service
 --
 View this message in context:
 http://www.nabble.com/wsdl%3Aservice-soap12%3Aaddress-set-to-0.0.0.0%2C-why--tf4432083.html#a12644352
 Sent from the Axis - User mailing list archive at Nabble.com.


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


 
 
 -- 
 Davanum Srinivas :: http://davanum.wordpress.com
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/wsdl%3Aservice-soap12%3Aaddress-set-to-0.0.0.0%2C-why--tf4432083.html#a12654467
Sent from the Axis - User mailing list archive at Nabble.com.


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



wsdl:service soap12:address set to 0.0.0.0, why?

2007-09-12 Thread Daniel Herbison

I have a service running under axis2, on one server, and it runs great but
when I take the aar file and copy it to another server, to run under a
different instance of axis2, I get this 0.0.0.0 soap address and the client
I'm using doesn't like it!  Why?  The original server places the host ip in
that position. Do I have axis2 or tomcat set up incorrectly?

- wsdl:service name=IEventService
- wsdl:port name=IEventServiceSOAP11port_http
binding=axis2:IEventServiceSOAP11Binding
  soap:address location=http://0.0.0.0:8086/axis2/services/IEventService;
/ 
  /wsdl:port
- wsdl:port name=IEventServiceSOAP12port_http
binding=axis2:IEventServiceSOAP12Binding
  soap12:address
location=http://0.0.0.0:8086/axis2/services/IEventService; / 
  /wsdl:port
- wsdl:port name=IEventServiceHttpport
binding=axis2:IEventServiceHttpBinding
  http:address location=http://0.0.0.0:8086/axis2/services/IEventService;
/ 
  /wsdl:port
  /wsdl:service
-- 
View this message in context: 
http://www.nabble.com/wsdl%3Aservice-soap12%3Aaddress-set-to-0.0.0.0%2C-why--tf4432083.html#a12644352
Sent from the Axis - User mailing list archive at Nabble.com.


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



Re: [Axis2] Creating Axis2 SOAP Header

2007-05-11 Thread Daniel Herbison

Thank you so far for your help!

The code is getting to the call (invokeBlocking) but is failing with this
exception:

Exception in thread main org.apache.axiom.soap.SOAPProcessingException:
Expecting an implementation of SOAP Envelope as the parent. But received
some other implementation

Could the header be causing this?

When I print the header I see (this looks ok):
soapenv:Header xmlns:soapenv=http://www.w3.org/2003/05/soap-envelope;
 BasicCredentials xmlns=beta
  serviceIdstring1/serviceId
  serviceKeystring2/serviceKey
 /BasicCredentials
/soapenv:Header

current code:
RPCServiceClient serviceClient = new RPCServiceClient();
Options options = serviceClient.getOptions();
options.setSoapVersionURI(org.apache.axis2.namespace.Constants.URI_SOAP12_ENV);
options.setTo(targetEPR);

// start header build
SOAPFactory factory = (SOAPFactory) OMAbstractFactory.getSOAP12Factory();
OMNamespace omNs = factory.createOMNamespace(beta, ); 
SOAPHeader header = factory.createSOAPHeader();
OMElement basicCredentials = factory.createOMElement(BasicCredentials,
omNs); 
OMElement serviceId = factory.createOMElement(serviceId, omNs); 
OMText serviceIdText = factory.createOMText(serviceId, agentID);
serviceId.addChild(serviceIdText); 
OMElement serviceKey = factory.createOMElement(serviceKey, omNs); 
OMText serviceKeyText = factory.createOMText(serviceKey, agentToken);
serviceKey.addChild(serviceKeyText); 
basicCredentials.addChild(serviceId);
basicCredentials.addChild(serviceKey);
header.addChild(basicCredentials);
// end header build

serviceClient.addHeader(header);
QName opSetClaim = new QName(beta, GetClaim );
Object[] opSetParams = new Object[] { agentID, agentToken, requestor };
Class[] returnTypes = new Class[] { Object.class };
Exception occuring on next line
Object[] response = serviceClient.invokeBlocking(opSetClaim, opSetParams,
returnTypes);


Eran Chinthaka wrote:
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Ok, the first advice is *never* use impl classes inside Axiom. Always
 use the factories. The reason is we have multiple implementations of them.
 
 To correct your problem, the easiest way is to create an OMElement
 rather than a SOAPHeaderBlock and call serviceClient.addHeader(OMElement).
 
 The second option is to use the created SOAP12Factory to create
 SOAPHeaderBlock.
 use soapFactory.createSOAPHeaderBlock(...)
 
 HTH.
 Chinthaka
 
 Daniel Herbison wrote:
 I'm trying to add the SOAP header, described in comment in code below, to
 a
 RPC call to a service.  First of all I really do not know if the code to
 create the header is correct, i think it is in the ball park(?)  But I
 get a
 run time error of:
 
 Exception in thread main java.lang.ClassCastException:
 org.apache.axiom.om.impl.OMNamespaceImpl
 at
 org.apache.axiom.soap.impl.dom.SOAPHeaderBlockImpl.init(SOAPHeaderBlockImpl.java:54)
 at
 org.apache.axiom.soap.impl.dom.soap12.SOAP12HeaderBlockImpl.init(SOAP12HeaderBlockImpl.java:45)
 at rpcAxSys.main(Unknown Source)
 
 the line causing the run time error is marked below, why is this doing
 this? 
 Also, is the header creation correct?
 
 code--
 RPCServiceClient serviceClient = new RPCServiceClient();
 Options options = serviceClient.getOptions();
 EndpointReference targetEPR = new
 EndpointReference(https://xyz/Authorize/Service.asmx;);
 options.setTo(targetEPR);
 
 /* header build
  soap:Header
   BasicCredentials xmlns=beta
serviceIdstring1/serviceId
serviceKeystring2/serviceKey  
   /BasicCredentials
  /soap:Header
  */
 OMFactory fac = OMAbstractFactory.getOMFactory();
 OMNamespace omNs = fac.createOMNamespace(beta, xmlns); 
 
 SOAPFactory soapFactory = new SOAP12Factory(); 
 SOAPHeaderBlock soapHeaderBlock = new
 SOAP12HeaderBlockImpl(Security,omNs,soapFactory); 
 soapHeaderBlock.setMustUnderstand(true); 
 
 OMElement basicCredentials = fac.createOMElement(BasicCredentials,
 omNs); 
 
 OMElement serviceId = fac.createOMElement(serviceId, omNs); 
 OMText serviceIdText = fac.createOMText(serviceId, agentID);
 serviceId.addChild(serviceIdText); 
 
 OMElement serviceKey = fac.createOMElement(serviceKey, omNs); 
 OMText serviceKeyText = fac.createOMText(serviceKey, agentToken);
 serviceKey.addChild(serviceKeyText); 
 
 basicCredentials.addChild(serviceId); 
 basicCredentials.addChild(serviceKey); 
 
 soapHeaderBlock.addChild(basicCredentials); 
 
 serviceClient.addHeader(soapHeaderBlock); 
 // end header build
 
 QName opSetClaim = new QName(beta, GetClaim );
 
 Object[] opSetParams = new Object[] { agentID, agentToken, requestor };
 Class[] returnTypes = new Class[] { Object.class };
 
 Object[] response = serviceClient.invokeBlocking(opSetClaim, opSetParams,
 returnTypes);
 
 
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.3 (GNU/Linux)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
 iD8DBQFGQ/jSjON2uBzUhh8RAqVZAKC0exk4tKs9zIALPgI65NYyo+AbxQCePUqQ
 xt15TCLceO7fDJe517267k8=
 =duG+
 -END PGP SIGNATURE

Re: Creating Axis2 SOAP Header

2007-05-10 Thread Daniel Herbison

Thank you for your replies!
I tried the code below and still get a runtime casting error.

Exception in thread main java.lang.ClassCastException:
org.apache.axiom.soap.impl.llom.soap12.SOAP12Factory
at rpcAxSys.header2(Unknown Source)
at rpcAxSys.main(Unknown Source)

SOAP12Factory factory = (SOAP12Factory)
OMAbstractFactory.getSOAP12Factory();
OMNamespace omNs = factory.createOMNamespace(beta.va.nortel.com, xmlns); 

SOAPHeader header = factory.createSOAPHeader();

SOAPHeaderBlock block = factory.createSOAPHeaderBlock(BasicCredentials,
omNs);

OMElement serviceId = factory.createOMElement(serviceId, omNs); 
OMText serviceIdText = factory.createOMText(serviceId, agentID);
serviceId.addChild(serviceIdText); 

OMElement serviceKey = factory.createOMElement(serviceKey, omNs); 
OMText serviceKeyText = factory.createOMText(serviceKey, agentToken);
serviceKey.addChild(serviceKeyText); 

block.addChild(serviceId);
block.addChild(serviceKey);

header.addChild(block);


Amila Suriarachchi wrote:
 
 I am not sure about your problem.
 but add this code to specifically set the soap12 for service client.
 
 clientOptions = new Options();
 clientOptions.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI
 );
 serviceClient.setOptions(clientOptions);
 
 On 5/10/07, Michele Mazzucco [EMAIL PROTECTED] wrote:

 Daniel,

 I think the way you create the SOAPHeaderBlock is not correct. Can
 you try this way please?

 SOAP12Factory factory = (SOAP12Factory)
 OMAbstractFactory.getSOAP12Factory();
 OMNamespace omNs = factory.createOMNamespace(
 http://...;,
 ...
 );

 SOAPEnvelope env = factory.createSOAPEnvelope();
 SOAPHeader header = factory.createSOAPHeader();
 SOAPHeaderBlock block = factory.createSOAPHeaderBlock(
 SOAPHeaderConstants.ELEM_QOSP_HEADER_BLOCK, omNs);
 OMElement type = factory.createOMElement(
 SOAPHeaderConstants.ELEM_MESSAGE_TYPE, omNs);

 type.setText(MessageType.UPLOAD.value());
 block.addChild(type);
 header.addChild(block);

 SOAPBody body = factory.createSOAPBody();
 OMElement method = factory.createOMElement(SOAPUtils.UPLOAD_SERVICE,
 omNs);

 OMElement name = factory.createOMElement(
 SOAPUtils.UPLOAD_SERVICE_FILE_NAME, omNs);
 name.setText(this.fileName);

 method.addChild(name);
 body.addChild(method);
 env.addChild(header);
 env.addChild(body);


 Michele




 On 9 May 2007, at 22:26, Daniel Herbison wrote:

 
  I'm trying to add the SOAP header, described in comment in code
  below, to a
  RPC call to a service.  First of all I really do not know if the
  code to
  create the header is correct, i think it is in the ball park(?)
  But I get a
  run time error of:
 
  Exception in thread main java.lang.ClassCastException:
  org.apache.axiom.om.impl.OMNamespaceImpl
  at
  org.apache.axiom.soap.impl.dom.SOAPHeaderBlockImpl.init
  (SOAPHeaderBlockImpl.java:54)
  at
  org.apache.axiom.soap.impl.dom.soap12.SOAP12HeaderBlockImpl.init
  (SOAP12HeaderBlockImpl.java:45)
  at rpcAxSys.main(Unknown Source)
 
  the line causing the run time error is marked below, why is this
  doing this?
  Also, is the header creation correct?
 
  code--
  RPCServiceClient serviceClient = new RPCServiceClient();
  Options options = serviceClient.getOptions();
  EndpointReference targetEPR = new
  EndpointReference(https://xyz/Authorize/Service.asmx;);
  options.setTo(targetEPR);
 
  /* header build
   soap:Header
BasicCredentials xmlns=beta
 serviceIdstring1/serviceId
 serviceKeystring2/serviceKey
/BasicCredentials
   /soap:Header
   */
  OMFactory fac = OMAbstractFactory.getOMFactory();
  OMNamespace omNs = fac.createOMNamespace(beta, xmlns);
 
  SOAPFactory soapFactory = new SOAP12Factory();
  SOAPHeaderBlock soapHeaderBlock = new
  SOAP12HeaderBlockImpl(Security,omNs,soapFactory);
  soapHeaderBlock.setMustUnderstand(true);
 
  OMElement basicCredentials = fac.createOMElement
  (BasicCredentials, omNs);
 
  OMElement serviceId = fac.createOMElement(serviceId, omNs);
  OMText serviceIdText = fac.createOMText(serviceId, agentID);
  serviceId.addChild(serviceIdText);
 
  OMElement serviceKey = fac.createOMElement(serviceKey, omNs);
  OMText serviceKeyText = fac.createOMText(serviceKey, agentToken);
  serviceKey.addChild(serviceKeyText);
 
  basicCredentials.addChild(serviceId);
  basicCredentials.addChild(serviceKey);
 
  soapHeaderBlock.addChild(basicCredentials);
 
  serviceClient.addHeader(soapHeaderBlock);
  // end header build
 
  QName opSetClaim = new QName(beta, GetClaim );
 
  Object[] opSetParams = new Object[] { agentID, agentToken,
  requestor };
  Class[] returnTypes = new Class[] { Object.class };
 
  Object[] response = serviceClient.invokeBlocking(opSetClaim,
  opSetParams,
  returnTypes);
 
  --
  View this message in context: http://www.nabble.com/Creating-Axis2-
  SOAP-Header-tf3718396.html#a10403132
  Sent from the Axis - User

Re: Creating Axis2 SOAP Header

2007-05-10 Thread Daniel Herbison

I changed this:

SOAPFactory factory = (SOAPFactory) OMAbstractFactory.getSOAP12Factory();

and got rid of the error but it is failing on the call with:

Exception in thread main org.apache.axiom.soap.SOAPProcessingException:
Expecting an implementation of SOAP Envelope as the parent. But received
some other implementation
at
org.apache.axiom.soap.impl.llom.SOAPHeaderImpl.checkParent(SOAPHeaderImpl.java:369)
at
org.apache.axiom.soap.impl.llom.SOAPElement.setParent(SOAPElement.java:75)
at
org.apache.axiom.om.impl.llom.OMElementImpl.addChild(OMElementImpl.java:236)
at
org.apache.axiom.om.impl.llom.OMElementImpl.addChild(OMElementImpl.java:192)
at
org.apache.axis2.client.ServiceClient.addHeadersToEnvelope(ServiceClient.java:647)
at
org.apache.axis2.client.ServiceClient.fillSOAPEnvelope(ServiceClient.java:633)
at
org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:517)
at
org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:500)
at
org.apache.axis2.rpc.client.RPCServiceClient.invokeBlocking(RPCServiceClient.java:97)
at rpcAxSys.main(rpcAxSys.java:51)

Is there a way to print the soap message out before calling invokeBlocking?

Code excluding header code, same as before.

rpcAxSys rpc = new rpcAxSys(args[0],args[1],args[2]);
EndpointReference targetEPR = new
EndpointReference(https://pcary571.corp.nortel.com/Authorize/Service.asmx;);
RPCServiceClient serviceClient = new RPCServiceClient();
Options options = serviceClient.getOptions();
options.setTo(targetEPR);
serviceClient.addHeader(rpc.header2());  // header2 has header generation
code below
QName opSetClaim = new QName(beta, GetClaim );
Object[] opSetParams = new Object[] { rpc.agentID, rpc.agentToken,
rpc.requestor };
Class[] returnTypes = new Class[] { Object.class };
Object[] response = serviceClient.invokeBlocking(opSetClaim, opSetParams,
returnTypes); FAILING HERE 




Michele Mazzucco-2 wrote:
 
 Daniel,
 
 could you please enable the debug  of javac (it is enabled by default,
 remove the -g:none option) and tell us which line causes the problem?
 
 Michele
 
 On Thu, 2007-05-10 at 05:28 -0700, Daniel Herbison wrote:
 Thank you for your replies!
 I tried the code below and still get a runtime casting error.
 
 Exception in thread main java.lang.ClassCastException:
 org.apache.axiom.soap.impl.llom.soap12.SOAP12Factory
 at rpcAxSys.header2(Unknown Source)
 at rpcAxSys.main(Unknown Source)
 
 SOAP12Factory factory = (SOAP12Factory)
 OMAbstractFactory.getSOAP12Factory();
 OMNamespace omNs = factory.createOMNamespace(beta.va.nortel.com,
 xmlns); 
 
 SOAPHeader header = factory.createSOAPHeader();
 
 SOAPHeaderBlock block = factory.createSOAPHeaderBlock(BasicCredentials,
 omNs);
 
 OMElement serviceId = factory.createOMElement(serviceId, omNs); 
 OMText serviceIdText = factory.createOMText(serviceId, agentID);
 serviceId.addChild(serviceIdText); 
 
 OMElement serviceKey = factory.createOMElement(serviceKey, omNs); 
 OMText serviceKeyText = factory.createOMText(serviceKey, agentToken);
 serviceKey.addChild(serviceKeyText); 
 
 block.addChild(serviceId);
 block.addChild(serviceKey);
 
 header.addChild(block);
 
 
 Amila Suriarachchi wrote:
  
  I am not sure about your problem.
  but add this code to specifically set the soap12 for service client.
  
  clientOptions = new Options();
 
 clientOptions.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI
  );
  serviceClient.setOptions(clientOptions);
  
  On 5/10/07, Michele Mazzucco [EMAIL PROTECTED] wrote:
 
  Daniel,
 
  I think the way you create the SOAPHeaderBlock is not correct. Can
  you try this way please?
 
  SOAP12Factory factory = (SOAP12Factory)
  OMAbstractFactory.getSOAP12Factory();
  OMNamespace omNs = factory.createOMNamespace(
  http://...;,
  ...
  );
 
  SOAPEnvelope env = factory.createSOAPEnvelope();
  SOAPHeader header = factory.createSOAPHeader();
  SOAPHeaderBlock block = factory.createSOAPHeaderBlock(
  SOAPHeaderConstants.ELEM_QOSP_HEADER_BLOCK, omNs);
  OMElement type = factory.createOMElement(
  SOAPHeaderConstants.ELEM_MESSAGE_TYPE, omNs);
 
  type.setText(MessageType.UPLOAD.value());
  block.addChild(type);
  header.addChild(block);
 
  SOAPBody body = factory.createSOAPBody();
  OMElement method = factory.createOMElement(SOAPUtils.UPLOAD_SERVICE,
  omNs);
 
  OMElement name = factory.createOMElement(
  SOAPUtils.UPLOAD_SERVICE_FILE_NAME, omNs);
  name.setText(this.fileName);
 
  method.addChild(name);
  body.addChild(method);
  env.addChild(header);
  env.addChild(body);
 
 
  Michele
 
 
 
 
  On 9 May 2007, at 22:26, Daniel Herbison wrote:
 
  
   I'm trying to add the SOAP header, described in comment in code
   below, to a
   RPC call to a service.  First of all I really do not know if the
   code to
   create the header is correct, i think

Creating Axis2 SOAP Header

2007-05-09 Thread Daniel Herbison

I'm trying to add the SOAP header, described in comment in code below, to a
RPC call to a service.  First of all I really do not know if the code to
create the header is correct, i think it is in the ball park(?)  But I get a
run time error of:

Exception in thread main java.lang.ClassCastException:
org.apache.axiom.om.impl.OMNamespaceImpl
at
org.apache.axiom.soap.impl.dom.SOAPHeaderBlockImpl.init(SOAPHeaderBlockImpl.java:54)
at
org.apache.axiom.soap.impl.dom.soap12.SOAP12HeaderBlockImpl.init(SOAP12HeaderBlockImpl.java:45)
at rpcAxSys.main(Unknown Source)

the line causing the run time error is marked below, why is this doing this? 
Also, is the header creation correct?

code--
RPCServiceClient serviceClient = new RPCServiceClient();
Options options = serviceClient.getOptions();
EndpointReference targetEPR = new
EndpointReference(https://xyz/Authorize/Service.asmx;);
options.setTo(targetEPR);

/* header build
 soap:Header
  BasicCredentials xmlns=beta
   serviceIdstring1/serviceId
   serviceKeystring2/serviceKey  
  /BasicCredentials
 /soap:Header
 */
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace(beta, xmlns); 

SOAPFactory soapFactory = new SOAP12Factory(); 
SOAPHeaderBlock soapHeaderBlock = new
SOAP12HeaderBlockImpl(Security,omNs,soapFactory); 
soapHeaderBlock.setMustUnderstand(true); 

OMElement basicCredentials = fac.createOMElement(BasicCredentials, omNs); 

OMElement serviceId = fac.createOMElement(serviceId, omNs); 
OMText serviceIdText = fac.createOMText(serviceId, agentID);
serviceId.addChild(serviceIdText); 

OMElement serviceKey = fac.createOMElement(serviceKey, omNs); 
OMText serviceKeyText = fac.createOMText(serviceKey, agentToken);
serviceKey.addChild(serviceKeyText); 

basicCredentials.addChild(serviceId); 
basicCredentials.addChild(serviceKey); 

soapHeaderBlock.addChild(basicCredentials); 

serviceClient.addHeader(soapHeaderBlock); 
// end header build

QName opSetClaim = new QName(beta, GetClaim );

Object[] opSetParams = new Object[] { agentID, agentToken, requestor };
Class[] returnTypes = new Class[] { Object.class };

Object[] response = serviceClient.invokeBlocking(opSetClaim, opSetParams,
returnTypes);

-- 
View this message in context: 
http://www.nabble.com/Creating-Axis2-SOAP-Header-tf3718396.html#a10403132
Sent from the Axis - User mailing list archive at Nabble.com.


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



WstxEOFException Exception

2007-05-01 Thread Daniel Herbison

Hi!
I'm trying to consume a service using axis2 axiom and get the following
exception, anyone know why?
Axiom code is below also.

org.apache.axis2.AxisFault: com.ctc.wstx.exc.WstxEOFException: Unexpected
EOF in prolog
 at [row,col {unknown-source}]: [1,0]; nested exception is: 
org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxEOFException:
Unexpected EOF in prolog
 at [row,col {unknown-source}]: [1,0]
at
org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:126)
at
org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:67)
at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:252)
at
org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:202)
at
org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:579)
at
org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:508)
at test1.main(test1.java:51)
Caused by: org.apache.axiom.om.OMException:
com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
 at [row,col {unknown-source}]: [1,0]
at
org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:199)
at
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:158)
at
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.identifySOAPVersion(StAXSOAPModelBuilder.java:132)
at
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.init(StAXSOAPModelBuilder.java:107)
at
org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:120)
... 6 more
Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
 at [row,col {unknown-source}]: [1,0]
at 
com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661)
at 
com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134)
at
com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
at
org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:116)
... 10 more


CODE...

System.out.println(GetClaim(+id+,+token+,+requestor+));
OMElement GetClaim = GetClaim(id,token,requestor);

Options options = new Options();
options.setTo(targetEPR);
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);

ServiceClient sender = new ServiceClient();
sender.setOptions(options);
OMElement result = sender.sendReceive(GetClaim);


-- 
View this message in context: 
http://www.nabble.com/WstxEOFException-Exception-tf3675595.html#a10270755
Sent from the Axis - User mailing list archive at Nabble.com.


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