Hi,
I'm trying to set the ReplyTo header in my soap request. This is my code. It doesn't seem to set the header correctly.
@Grapes([
@Grab(group = 'com.github.rahulsom', module = 'ihe-iti', version = '0.3'),
@Grab(group = 'org.apache.cxf', module = 'cxf-rt-ws-addr', version = '2.6.7'),
])
import ihe.iti.xds_b._2007.RespondingGatewayQueryService
import oasis.names.tc.ebxml_regrep.xsd.query._3.AdhocQueryRequest
import oasis.names.tc.ebxml_regrep.xsd.query._3.ResponseOptionType
import oasis.names.tc.ebxml_regrep.xsd.rim._3.AdhocQueryType
import oasis.names.tc.ebxml_regrep.xsd.rim._3.SlotType1
import oasis.names.tc.ebxml_regrep.xsd.rim._3.ValueListType
import org.apache.cxf.ws.addressing.WSAContextUtils
import javax.xml.ws.BindingProvider
import javax.xml.ws.soap.AddressingFeature
RespondingGatewayQueryService theService = new RespondingGatewayQueryService(new URL('http://localhost:8080/healthdock/alpine/xca-r-query?wsdl'))
def thePort = theService.getRespondingGatewayQueryPortSoap12(new AddressingFeature(true, true))
BindingProvider bp = thePort
bp.requestContext[BindingProvider.ENDPOINT_ADDRESS_PROPERTY] = 'http://localhost:8080/healthdock/alpine/xca-r-query'
bp.requestContext[WSAContextUtils.REPLYTO_PROPERTY] = 'http://localhost:9090/decoupled_endpoint'
def query = new AdhocQueryRequest()
.withAdhocQuery(new AdhocQueryType()
.withId('123')
.withSlot(
new SlotType1(name: '$XDSDocumentEntryPatientId', valueList: new ValueListType(value: ['123^^^&1.2.3.4&ISO'])),
new SlotType1(
name: '$XDSDocumentEntryStatus',
valueList: new ValueListType(value: [
'urn:oasis:names:tc:ebxml-regrep:StatusType:Approved',
]))
.withResponseOption(new ResponseOptionType()
.withReturnType('LeafClass')
.withReturnComposedObjects(true)
thePort.respondingGatewayCrossGatewayQuery(query)
This is what I receive at the server
ID: 7
Address: http://localhost:8080/healthdock/services/receivingGatewayQuery
Encoding: UTF-8
Http-Method: POST
Content-Type: application/soap+xml; charset=utf-8;action="urn:ihe:iti:2007:CrossGatewayQuery"
Headers: {Accept=[application/soap+xml, multipart/related], connection=[keep-alive], Content-Length=[1440], content-type=[application/soap+xml; charset=utf-8;action="urn:ihe:iti:2007:CrossGatewayQuery"], host=[localhost:8080], user-agent=[JAX-WS RI 2.2.4-b01]}
Payload: <?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope"><S:Header><To xmlns="http://www.w3.org/2005/08/addressing">http://localhost:8080/healthdock/alpine/xca-r-query</To><Action xmlns="http://www.w3.org/2005/08/addressing" xmlns:S="http://www.w3.org/2003/05/soap-envelope" S:mustUnderstand="true">urn:ihe:iti:2007:CrossGatewayQuery</Action><ReplyTo xmlns="http://www.w3.org/2005/08/addressing">
<Address>http://www.w3.org/2005/08/addressing/anonymous</Address>
</ReplyTo><MessageID xmlns="http://www.w3.org/2005/08/addressing">uuid:cd66b8bb-ce01-4ec0-98ff-fa03c368619a</MessageID></S:Header><S:Body><ns6:AdhocQueryRequest xmlns:ns2="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0" xmlns:ns3="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0" xmlns:ns4="urn:oasis:names:tc:ebxml-regrep:xsd:lcm:3.0" xmlns:ns5="urn:ihe:iti:xds-b:2007" xmlns:ns6="urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0" xmlns:ns7="urn:oasis:names:tc:ebxml-regrep:xsd:cms:3.0"><ns6:ResponseOption returnType="LeafClass" returnComposedObjects="true"/><ns2:AdhocQuery id="123"><ns2:Slot name="$XDSDocumentEntryPatientId"><ns2:ValueList><ns2:Value>123^^^&1.2.3.4&ISO</ns2:Value></ns2:ValueList></ns2:Slot><ns2:Slot name="$XDSDocumentEntryStatus"><ns2:ValueList><ns2:Value>urn:oasis:names:tc:ebxml-regrep:StatusType:Approved</ns2:Value></ns2:ValueList></ns2:Slot></ns2:AdhocQuery></ns6:AdhocQueryRequest></S:Body></S:Envelope>
Any hints as to what I'm doing wrong? Oh, and my code is in groovy.
R,
rahul
I'm trying to set the ReplyTo header in my soap request. This is my code. It doesn't seem to set the header correctly.
@Grapes([
@Grab(group = 'com.github.rahulsom', module = 'ihe-iti', version = '0.3'),
@Grab(group = 'org.apache.cxf', module = 'cxf-rt-ws-addr', version = '2.6.7'),
])
import ihe.iti.xds_b._2007.RespondingGatewayQueryService
import oasis.names.tc.ebxml_regrep.xsd.query._3.AdhocQueryRequest
import oasis.names.tc.ebxml_regrep.xsd.query._3.ResponseOptionType
import oasis.names.tc.ebxml_regrep.xsd.rim._3.AdhocQueryType
import oasis.names.tc.ebxml_regrep.xsd.rim._3.SlotType1
import oasis.names.tc.ebxml_regrep.xsd.rim._3.ValueListType
import org.apache.cxf.ws.addressing.WSAContextUtils
import javax.xml.ws.BindingProvider
import javax.xml.ws.soap.AddressingFeature
RespondingGatewayQueryService theService = new RespondingGatewayQueryService(new URL('http://localhost:8080/healthdock/alpine/xca-r-query?wsdl'))
def thePort = theService.getRespondingGatewayQueryPortSoap12(new AddressingFeature(true, true))
BindingProvider bp = thePort
bp.requestContext[BindingProvider.ENDPOINT_ADDRESS_PROPERTY] = 'http://localhost:8080/healthdock/alpine/xca-r-query'
bp.requestContext[WSAContextUtils.REPLYTO_PROPERTY] = 'http://localhost:9090/decoupled_endpoint'
def query = new AdhocQueryRequest()
.withAdhocQuery(new AdhocQueryType()
.withId('123')
.withSlot(
new SlotType1(name: '$XDSDocumentEntryPatientId', valueList: new ValueListType(value: ['123^^^&1.2.3.4&ISO'])),
new SlotType1(
name: '$XDSDocumentEntryStatus',
valueList: new ValueListType(value: [
'urn:oasis:names:tc:ebxml-regrep:StatusType:Approved',
]))
.withResponseOption(new ResponseOptionType()
.withReturnType('LeafClass')
.withReturnComposedObjects(true)
thePort.respondingGatewayCrossGatewayQuery(query)
This is what I receive at the server
ID: 7
Address: http://localhost:8080/healthdock/services/receivingGatewayQuery
Encoding: UTF-8
Http-Method: POST
Content-Type: application/soap+xml; charset=utf-8;action="urn:ihe:iti:2007:CrossGatewayQuery"
Headers: {Accept=[application/soap+xml, multipart/related], connection=[keep-alive], Content-Length=[1440], content-type=[application/soap+xml; charset=utf-8;action="urn:ihe:iti:2007:CrossGatewayQuery"], host=[localhost:8080], user-agent=[JAX-WS RI 2.2.4-b01]}
Payload: <?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope"><S:Header><To xmlns="http://www.w3.org/2005/08/addressing">http://localhost:8080/healthdock/alpine/xca-r-query</To><Action xmlns="http://www.w3.org/2005/08/addressing" xmlns:S="http://www.w3.org/2003/05/soap-envelope" S:mustUnderstand="true">urn:ihe:iti:2007:CrossGatewayQuery</Action><ReplyTo xmlns="http://www.w3.org/2005/08/addressing">
<Address>http://www.w3.org/2005/08/addressing/anonymous</Address>
</ReplyTo><MessageID xmlns="http://www.w3.org/2005/08/addressing">uuid:cd66b8bb-ce01-4ec0-98ff-fa03c368619a</MessageID></S:Header><S:Body><ns6:AdhocQueryRequest xmlns:ns2="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0" xmlns:ns3="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0" xmlns:ns4="urn:oasis:names:tc:ebxml-regrep:xsd:lcm:3.0" xmlns:ns5="urn:ihe:iti:xds-b:2007" xmlns:ns6="urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0" xmlns:ns7="urn:oasis:names:tc:ebxml-regrep:xsd:cms:3.0"><ns6:ResponseOption returnType="LeafClass" returnComposedObjects="true"/><ns2:AdhocQuery id="123"><ns2:Slot name="$XDSDocumentEntryPatientId"><ns2:ValueList><ns2:Value>123^^^&1.2.3.4&ISO</ns2:Value></ns2:ValueList></ns2:Slot><ns2:Slot name="$XDSDocumentEntryStatus"><ns2:ValueList><ns2:Value>urn:oasis:names:tc:ebxml-regrep:StatusType:Approved</ns2:Value></ns2:ValueList></ns2:Slot></ns2:AdhocQuery></ns6:AdhocQueryRequest></S:Body></S:Envelope>
Any hints as to what I'm doing wrong? Oh, and my code is in groovy.
R,
rahul