Announcement

Collapse
No announcement yet.

how to send javaObjects in SOAP Envelope

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to send javaObjects in SOAP Envelope

    hi to all,

    i could not able to send javaBean object to my web service, I am able to get all getMethods which doesn't take any parameters but i cont able to invoke setMethods() which takes parameters like Long/UserDefinedJavaBeanObject.
    i have one of the method called addNewPatient(RecordBean record) in my web service which was deployed in jboss4.2.0 server,
    i am successfuly able to create RecordBean object in my transformer but when i try to pass this object in my SOAPEnvelope i am getting NullPointerException in both mirth and jboss server side.


    MYSOAP Envelope looks like this:
    <?xml version="1.0" encoding="utf-16"?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <addNewPatient xmlns="http://services.healthcare.ndo.com/">
    <addNewPatient>
    <arg0>${obj}</arg0>
    </addNewPatient>
    </addNewPatient>
    </soap:Body>
    </soap:Envelope>

    there is no issue in object creation, i have tested the object by seding to other destination, is their any other way to send object inputs in SOAP Envelope.


    Mirth given Error is:

    ERROR-410: SOAP Connector error
    ERROR MESSAGE: Error invoking WebService
    AxisFault
    faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server
    faultSubcode:
    faultString: java.lang.NullPointerException
    faultActor:
    faultNode:
    faultDetail:
    {http://xml.apache.org/axis/}stackTrace:java.lang.NullPointerException
    at org.apache.axis.message.SOAPFaultBuilder.createFau lt(SOAPFaultBuilder.java:221)
    at org.apache.axis.message.SOAPFaultBuilder.endElemen t(SOAPFaultBuilder.java:128)
    at org.apache.axis.encoding.DeserializationContext.en dElement(DeserializationContext.java:1087)
    at org.apache.xerces.parsers.AbstractSAXParser.endEle ment(Unknown Source)
    at org.apache.xerces.impl.XMLNSDocumentScannerImpl.sc anEndElement(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl$FragmentContentDispatcher.dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl.scanDocument(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse( Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser .parse(Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
    at org.apache.axis.encoding.DeserializationContext.pa rse(DeserializationContext.java:227)
    at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPar t.java:696)
    at org.apache.axis.Message.getSOAPEnvelope(Message.ja va:424)
    at org.apache.axis.client.Call.invokeEngine(Call.java :2785)
    at org.apache.axis.client.Call.invoke(Call.java:2748)
    at org.apache.axis.client.Call.invoke(Call.java:1862)
    at com.webreach.mirth.server.mule.providers.soap.axis .AxisMessageDispatcher.invokeWebService(AxisMessag eDispatcher.java:230)
    at com.webreach.mirth.server.mule.providers.soap.axis .AxisMessageDispatcher.doSend(AxisMessageDispatche r.java:258)
    at org.mule.providers.AbstractMessageDispatcher.send( AbstractMessageDispatcher.java:166)
    at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:191)
    at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:130)
    at org.mule.routing.outbound.AbstractOutboundRouter.s end(AbstractOutboundRouter.java:85)
    at org.mule.routing.outbound.FilteringMulticastingRou ter.route(FilteringMulticastingRouter.java:89)
    at org.mule.routing.outbound.OutboundMessageRouter$1. doInTransaction(OutboundMessageRouter.java:78)
    at org.mule.transaction.TransactionTemplate.execute(T ransactionTemplate.java:48)
    at org.mule.routing.outbound.OutboundMessageRouter.ro ute(OutboundMessageRouter.java:82)
    at org.mule.impl.model.DefaultMuleProxy.onCall(Defaul tMuleProxy.java:247)
    at org.mule.impl.model.seda.SedaComponent.doSend(Seda Component.java:209)
    at org.mule.impl.model.AbstractComponent.sendEvent(Ab stractComponent.java:277)
    at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:201)
    at org.mule.routing.inbound.InboundMessageRouter.send (InboundMessageRouter.java:161)
    at org.mule.routing.inbound.InboundMessageRouter.rout e(InboundMessageRouter.java:128)
    at org.mule.providers.AbstractMessageReceiver$Default InternalMessageListener.onMessage(AbstractMessageR eceiver.java:492)
    at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:271)
    at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:230)
    at com.webreach.mirth.server.mule.providers.file.File MessageReceiver.processFile(FileMessageReceiver.ja va:186)
    at com.webreach.mirth.server.mule.providers.file.File MessageReceiver.poll(FileMessageReceiver.java:114)
    at org.mule.providers.PollingMessageReceiver.run(Poll ingMessageReceiver.java:73)
    at org.mule.impl.work.WorkerContext.run(WorkerContext .java:290)
    at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.runTask(ThreadPoolExecutor. java:650)
    at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.run(ThreadPoolExecutor.java :675)
    at java.lang.Thread.run(Unknown Source)

    {http://xml.apache.org/axis/}hostname:GS66

    java.lang.NullPointerException
    at org.apache.axis.message.SOAPFaultBuilder.createFau lt(SOAPFaultBuilder.java:221)
    at org.apache.axis.message.SOAPFaultBuilder.endElemen t(SOAPFaultBuilder.java:128)
    at org.apache.axis.encoding.DeserializationContext.en dElement(DeserializationContext.java:1087)
    at org.apache.xerces.parsers.AbstractSAXParser.endEle ment(Unknown Source)
    at org.apache.xerces.impl.XMLNSDocumentScannerImpl.sc anEndElement(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl$FragmentContentDispatcher.dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl.scanDocument(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse( Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser .parse(Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
    at org.apache.axis.encoding.DeserializationContext.pa rse(DeserializationContext.java:227)
    at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPar t.java:696)
    at org.apache.axis.Message.getSOAPEnvelope(Message.ja va:424)
    at org.apache.axis.client.Call.invokeEngine(Call.java :2785)
    at org.apache.axis.client.Call.invoke(Call.java:2748)
    at org.apache.axis.client.Call.invoke(Call.java:1862)
    at com.webreach.mirth.server.mule.providers.soap.axis .AxisMessageDispatcher.invokeWebService(AxisMessag eDispatcher.java:230)
    at com.webreach.mirth.server.mule.providers.soap.axis .AxisMessageDispatcher.doSend(AxisMessageDispatche r.java:258)
    at org.mule.providers.AbstractMessageDispatcher.send( AbstractMessageDispatcher.java:166)
    at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:191)
    at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:130)
    at org.mule.routing.outbound.AbstractOutboundRouter.s end(AbstractOutboundRouter.java:85)
    at org.mule.routing.outbound.FilteringMulticastingRou ter.route(FilteringMulticastingRouter.java:89)
    at org.mule.routing.outbound.OutboundMessageRouter$1. doInTransaction(OutboundMessageRouter.java:78)
    at org.mule.transaction.TransactionTemplate.execute(T ransactionTemplate.java:48)
    at org.mule.routing.outbound.OutboundMessageRouter.ro ute(OutboundMessageRouter.java:82)
    at org.mule.impl.model.DefaultMuleProxy.onCall(Defaul tMuleProxy.java:247)
    at org.mule.impl.model.seda.SedaComponent.doSend(Seda Component.java:209)
    at org.mule.impl.model.AbstractComponent.sendEvent(Ab stractComponent.java:277)
    at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:201)
    at org.mule.routing.inbound.InboundMessageRouter.send (InboundMessageRouter.java:161)
    at org.mule.routing.inbound.InboundMessageRouter.rout e(InboundMessageRouter.java:128)
    at org.mule.providers.AbstractMessageReceiver$Default InternalMessageListener.onMessage(AbstractMessageR eceiver.java:492)
    at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:271)
    at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:230)
    at com.webreach.mirth.server.mule.providers.file.File MessageReceiver.processFile(FileMessageReceiver.ja va:186)
    at com.webreach.mirth.server.mule.providers.file.File MessageReceiver.poll(FileMessageReceiver.java:114)
    at org.mule.providers.PollingMessageReceiver.run(Poll ingMessageReceiver.java:73)
    at org.mule.impl.work.WorkerContext.run(WorkerContext .java:290)
    at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.runTask(ThreadPoolExecutor. java:650)
    at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.run(ThreadPoolExecutor.java :675)
    at java.lang.Thread.run(Unknown Source)

  • #2
    Re:how to send javaObjects in SOAP Envelope

    Whate is {obj} ? If it's a java serialized object, you need to serialize it previously in the transformer.

    ┬┐What kind of element is <arg0> ? If it's a string, you need to escape the '<' and '&'. ┬┐Could you post your WSDL?

    BTW, it's a horrible interoperability soution to send Java Object using WS. For this issue JMS was defined.

    Comment


    • #3
      Re:how to send javaObjects in SOAP Envelope

      hi to all,

      i not able to invoke my sample web service which is deployed in jboss 4.2.0 & jbossws1.2.1 server, it is as fallows(but the same service was able to invoke from mirth channel when it was deployed in tomcat5.5 & Axis1.4)

      web service method is :
      sayPremitiveLong(long l);

      SOAP Envelope:

      <?xml version="1.0" encoding="utf-16"?>
      <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      <sayPremitiveLong xmlns="http://PatientSample/">
      <arg0>2</arg0>
      </sayPremitiveLong>
      </soap:Body>
      </soap:Envelope>


      ERROR-410: SOAP Connector error
      ERROR MESSAGE: Error invoking WebService
      AxisFault
      faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server
      faultSubcode:
      faultString: Cannot find child element: arg0
      faultActor:
      faultNode:
      faultDetail:
      {http://xml.apache.org/axis/}stackTrace:Cannot find child element: arg0
      at org.apache.axis.message.SOAPFaultBuilder.createFau lt(SOAPFaultBuilder.java:221)
      at org.apache.axis.message.SOAPFaultBuilder.endElemen t(SOAPFaultBuilder.java:128)
      at org.apache.axis.encoding.DeserializationContext.en dElement(DeserializationContext.java:1087)
      at org.apache.xerces.parsers.AbstractSAXParser.endEle ment(Unknown Source)
      at org.apache.xerces.impl.XMLNSDocumentScannerImpl.sc anEndElement(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl$FragmentContentDispatcher.dispatch(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl.scanDocument(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
      at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      at org.apache.xerces.parsers.AbstractSAXParser.parse( Unknown Source)
      at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser .parse(Unknown Source)
      at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
      at org.apache.axis.encoding.DeserializationContext.pa rse(DeserializationContext.java:227)
      at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPar t.java:696)
      at org.apache.axis.Message.getSOAPEnvelope(Message.ja va:424)
      at org.apache.axis.client.Call.invokeEngine(Call.java :2785)
      at org.apache.axis.client.Call.invoke(Call.java:2748)
      at org.apache.axis.client.Call.invoke(Call.java:1862)
      at com.webreach.mirth.server.mule.providers.soap.axis .AxisMessageDispatcher.invokeWebService(AxisMessag eDispatcher.java:230)
      at com.webreach.mirth.server.mule.providers.soap.axis .AxisMessageDispatcher.doSend(AxisMessageDispatche r.java:258)
      at org.mule.providers.AbstractMessageDispatcher.send( AbstractMessageDispatcher.java:166)
      at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:191)
      at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:130)
      at org.mule.routing.outbound.AbstractOutboundRouter.s end(AbstractOutboundRouter.java:85)
      at org.mule.routing.outbound.FilteringMulticastingRou ter.route(FilteringMulticastingRouter.java:89)
      at org.mule.routing.outbound.OutboundMessageRouter$1. doInTransaction(OutboundMessageRouter.java:78)
      at org.mule.transaction.TransactionTemplate.execute(T ransactionTemplate.java:48)
      at org.mule.routing.outbound.OutboundMessageRouter.ro ute(OutboundMessageRouter.java:82)
      at org.mule.impl.model.DefaultMuleProxy.onCall(Defaul tMuleProxy.java:247)
      at org.mule.impl.model.seda.SedaComponent.doSend(Seda Component.java:209)
      at org.mule.impl.model.AbstractComponent.sendEvent(Ab stractComponent.java:277)
      at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:201)
      at org.mule.routing.inbound.InboundMessageRouter.send (InboundMessageRouter.java:161)
      at org.mule.routing.inbound.InboundMessageRouter.rout e(InboundMessageRouter.java:128)
      at org.mule.providers.AbstractMessageReceiver$Default InternalMessageListener.onMessage(AbstractMessageR eceiver.java:492)
      at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:271)
      at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:230)
      at com.webreach.mirth.server.mule.providers.file.File MessageReceiver.processFile(FileMessageReceiver.ja va:186)
      at com.webreach.mirth.server.mule.providers.file.File MessageReceiver.poll(FileMessageReceiver.java:114)
      at org.mule.providers.PollingMessageReceiver.run(Poll ingMessageReceiver.java:73)
      at org.mule.impl.work.WorkerContext.run(WorkerContext .java:290)
      at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.runTask(ThreadPoolExecutor. java:650)
      at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.run(ThreadPoolExecutor.java :675)
      at java.lang.Thread.run(Unknown Source)

      {http://xml.apache.org/axis/}hostname:NDORANGE2

      Cannot find child element: arg0
      at org.apache.axis.message.SOAPFaultBuilder.createFau lt(SOAPFaultBuilder.java:221)
      at org.apache.axis.message.SOAPFaultBuilder.endElemen t(SOAPFaultBuilder.java:128)
      at org.apache.axis.encoding.DeserializationContext.en dElement(DeserializationContext.java:1087)
      at org.apache.xerces.parsers.AbstractSAXParser.endEle ment(Unknown Source)
      at org.apache.xerces.impl.XMLNSDocumentScannerImpl.sc anEndElement(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl$FragmentContentDispatcher.dispatch(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl.scanDocument(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
      at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      at org.apache.xerces.parsers.AbstractSAXParser.parse( Unknown Source)
      at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser .parse(Unknown Source)
      at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
      at org.apache.axis.encoding.DeserializationContext.pa rse(DeserializationContext.java:227)
      at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPar t.java:696)
      at org.apache.axis.Message.getSOAPEnvelope(Message.ja va:424)
      at org.apache.axis.client.Call.invokeEngine(Call.java :2785)
      at org.apache.axis.client.Call.invoke(Call.java:2748)
      at org.apache.axis.client.Call.invoke(Call.java:1862)
      at com.webreach.mirth.server.mule.providers.soap.axis .AxisMessageDispatcher.invokeWebService(AxisMessag eDispatcher.java:230)
      at com.webreach.mirth.server.mule.providers.soap.axis .AxisMessageDispatcher.doSend(AxisMessageDispatche r.java:258)
      at org.mule.providers.AbstractMessageDispatcher.send( AbstractMessageDispatcher.java:166)
      at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:191)
      at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:130)
      at org.mule.routing.outbound.AbstractOutboundRouter.s end(AbstractOutboundRouter.java:85)
      at org.mule.routing.outbound.FilteringMulticastingRou ter.route(FilteringMulticastingRouter.java:89)
      at org.mule.routing.outbound.OutboundMessageRouter$1. doInTransaction(OutboundMessageRouter.java:78)
      at org.mule.transaction.TransactionTemplate.execute(T ransactionTemplate.java:48)
      at org.mule.routing.outbound.OutboundMessageRouter.ro ute(OutboundMessageRouter.java:82)
      at org.mule.impl.model.DefaultMuleProxy.onCall(Defaul tMuleProxy.java:247)
      at org.mule.impl.model.seda.SedaComponent.doSend(Seda Component.java:209)
      at org.mule.impl.model.AbstractComponent.sendEvent(Ab stractComponent.java:277)
      at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:201)
      at org.mule.routing.inbound.InboundMessageRouter.send (InboundMessageRouter.java:161)
      at org.mule.routing.inbound.InboundMessageRouter.rout e(InboundMessageRouter.java:128)
      at org.mule.providers.AbstractMessageReceiver$Default InternalMessageListener.onMessage(AbstractMessageR eceiver.java:492)
      at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:271)
      at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:230)
      at com.webreach.mirth.server.mule.providers.file.File MessageReceiver.processFile(FileMessageReceiver.ja va:186)
      at com.webreach.mirth.server.mule.providers.file.File MessageReceiver.poll(FileMessageReceiver.java:114)
      at org.mule.providers.PollingMessageReceiver.run(Poll ingMessageReceiver.java:73)
      at org.mule.impl.work.WorkerContext.run(WorkerContext .java:290)
      at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.runTask(ThreadPoolExecutor. java:650)
      at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.run(ThreadPoolExecutor.java :675)
      at java.lang.Thread.run(Unknown Source)

      Comment

      Working...
      X