Adding ws-addressing "To" in APIM policy set-header or set-body

nj_prnd 21 Reputation points
2021-03-09T00:52:22.927+00:00

From APIM, I am calling a WCF backend service, which expects ws-addressing "To" set as default or to a certain value. Tried below combination but no luck <set-header name="Content-Type" exists-action="override"> <value>application/soap+xml; charset=utf-8; Action="http://tempuri.org/Iwap"; To="https://message-dev.abc.org.au/Services/Iwap.svc"</value> </set-header> <set-header name="SOAPAction" exists-action="override"> <value>http://tempuri.org/Iwap</value> </set-header> <set-header name="SOAPTo" exists-action="override"> <value>https://message-dev.abc.org.au/Services/Iwap.sv</value> </set-header> still get this error The message with To '' cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher. Check that the sender and receiver's EndpointAddresses agree.

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
1,752 questions
{count} votes

Accepted answer
  1. ChaitanyaNaykodi-MSFT 22,776 Reputation points Microsoft Employee
    2021-03-11T00:32:01.003+00:00

    Hello @nj_prnd ,
    You can try setting the <wsa:To> header in following manner.

            <set-body template="liquid">  
    			<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://tempuri.org/" >  
    				<soap:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">  
    					<wsa:To>https://message-dev.abc.org.au/Services/Iwap.svc</wsa:To>  
    				</soap:Header>  
    				<soap:Body>  
    				</soap:Body>  
    			</soap:Envelope>  
    		</set-body>  
    

    Please let me know if there are any additional concerns, I will be glad to continue with our discussion. Thank you!

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. nj_prnd 21 Reputation points
    2021-03-11T01:36:55.933+00:00

    Thank you Chaitanya, this works.

    0 comments No comments