This error is beyond my skill set so I apologize if I make some incorrect assumptions:
The ActivityId is assigned when the API call is made from the client to the server, so I'm assuming I don't have control on how its generated.
Assuming that I don't have control over the assignment of the ActivitId is this problem being caused by the handshaking between my IIS server and the endpoint?
Is there a modification I can make in the WSDL to address the problem?
I've posted the Trace events of the call and some code, please let me know what else is required to help troubleshoot the problem.
Below is the results found in the Trace Viewer, further down is my code:
<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
<System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
<EventID>0</EventID>
<Type>3</Type>
<SubType Name="Information">0</SubType>
<Level>8</Level>
<TimeCreated SystemTime="2015-04-22T15:34:40.7214893Z" />
<Source Name="System.ServiceModel.MessageLogging" />
<Correlation ActivityID="{e7ac11ba-8f49-474d-8960-b9e3cf2da931}" />
<Execution ProcessName="iisexpress" ProcessID="17112" ThreadID="8" />
<Channel />
<Computer>JROBINSON6274</Computer>
</System>
<ApplicationData>
<TraceData>
<DataItem>
<MessageLogTraceRecord Time="2015-04-22T11:34:40.7214893-04:00" Source="TransportSend" Type="System.ServiceModel.Dispatcher.OperationFormatter+OperationFormatterMessage" xmlns="http://schemas.microsoft.com/2004/06/ServiceModel/Management/MessageTrace">
<Addressing>
<Action>http://dpd.com/common/service/ShipmentService/3.2/storeOrders</Action>
<To>https://public-ws-stage.dpd.com/services/ShipmentService/V3_2/</To>
</Addressing>
<HttpRequest>
<Method>POST</Method>
<QueryString></QueryString>
<WebHeaders>
<VsDebuggerCausalityData>uIDPoxiCfR3BJXhAguLEZnDHinsAAAAAG4onPL7yhk6XmHXeB+x5TTT6sGl21b5CuCON4NUt0YEACQAA</VsDebuggerCausalityData>
</WebHeaders>
</HttpRequest>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:authentication xmlns:h="http://dpd.com/common/service/types/Authentication/2.0" xmlns="http://dpd.com/common/service/types/Authentication/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<delisId xmlns="">######</delisId>
<authToken xmlns="">##################################</authToken>
<messageLanguage xmlns="">#####</messageLanguage>
</h:authentication>
<ActivityId CorrelationId="548239ec-6a8b-4628-8a8e-81141f15b3a0" xmlns="http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics">e7ac11ba-8f49-474d-8960-b9e3cf2da931</ActivityId>
</s:Header>
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<storeOrders xmlns="http://dpd.com/common/service/types/ShipmentService/3.2">
<printOptions xmlns="">
<printerLanguage>PDF</printerLanguage>
<paperFormat>A6</paperFormat>
</printOptions>
<order xmlns="">
<generalShipmentData>
<identificationNumber>12345</identificationNumber>
<sendingDepot>0147</sendingDepot>
<product>CL</product>
<sender>
<name1>######</name1>
<street>#######</street>
<country>DE</country>
<zipCode>#####</zipCode>
<city>######</city>
<customerNumber>######</customerNumber>
</sender>
<recipient>
<name1>#######</name1>
<street>#########</street>
<country>####</country>
<zipCode>40599</zipCode>
<city>##########</city>
</recipient>
</generalShipmentData>
<parcels>
<customerReferenceNumber1>PDS124400203</customerReferenceNumber1>
</parcels>
<productAndServiceData>
<orderType>consignment</orderType>
</productAndServiceData>
</order>
</storeOrders>
</s:Body>
</s:Envelope>
</MessageLogTraceRecord>
</DataItem>
</TraceData>
<System.Diagnostics xmlns="http://schemas.microsoft.com/2004/08/System.Diagnostics">
<LogicalOperationStack></LogicalOperationStack>
<Timestamp>990348428488</Timestamp>
<Callstack>
at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
at System.Environment.get_StackTrace()
at System.Diagnostics.TraceEventCache.get_Callstack()
at System.Diagnostics.XmlWriterTraceListener.WriteFooter(TraceEventCache eventCache)
at System.Diagnostics.XmlWriterTraceListener.TraceData(TraceEventCache eventCache, String source, TraceEventType eventType, Int32 id, Object data)
at System.Diagnostics.TraceSource.TraceData(TraceEventType eventType, Int32 id, Object data)
at System.ServiceModel.Diagnostics.MessageLogger.LogInternal(MessageLoggingSource source, Object data)
at System.ServiceModel.Diagnostics.MessageLogger.LogInternal(MessageLogTraceRecord record)
at System.ServiceModel.Diagnostics.MessageLogger.LogMessageImpl(Message& message, XmlReader reader, MessageLoggingSource source)
at System.ServiceModel.Diagnostics.MessageLogger.LogMessage(Message& message, XmlReader reader, MessageLoggingSource source)
at System.ServiceModel.Channels.TextMessageEncoderFactory.TextMessageEncoder.WriteMessage(Message message, Int32 maxMessageSize, BufferManager bufferManager, Int32 messageOffset)
at System.ServiceModel.Channels.HttpOutput.SerializeBufferedMessage(Message message, Boolean shouldRecycleBuffer)
at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout)
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.SendRequest(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at DPDWebServiceShipment.ShipmentService_3_2.storeOrders(storeOrdersRequest request)
at DPDWebServiceShipment.ShipmentService_3_2Client.DPDWebServiceShipment.ShipmentService_3_2.storeOrders(storeOrdersRequest request) in c:\Users\Jeffrey\AppData\Local\Temp\Temporary ASP.NET Files\vs\97aba582\bf0e7c3e\App_WebReferences.lgiqd1ag.0.cs:line 3842
at DPDWebServiceShipment.ShipmentService_3_2Client.storeOrders(authentication authentication, storeOrders storeOrders1) in c:\Users\Jeffrey\AppData\Local\Temp\Temporary ASP.NET Files\vs\97aba582\bf0e7c3e\App_WebReferences.lgiqd1ag.0.cs:line 3849
at DPDLabels.Button1_Click(Object sender, EventArgs e) in c:\PDS_NET\Site\DPDLabels.aspx.cs:line 98
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.dpdlabels_aspx.ProcessRequest(HttpContext context) in c:\Users\Jeffrey\AppData\Local\Temp\Temporary ASP.NET Files\vs\97aba582\bf0e7c3e\App_Web_e5verntf.0.cs:line 0
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)
at System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb)
at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
</Callstack>
</System.Diagnostics>
</ApplicationData>
</E2ETraceEvent>
Here is my code:
using DPDWebServiceLogin;
using DPDWebServiceShipment;
public partial class DPDLabels : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
LoginServiceClient objLogin = new LoginServiceClient();
var objAuthToken = objLogin.getAuth("######", "######", "######");
Label1.Text = objAuthToken.authToken.ToString();
ShipmentService_3_2Client objShipment = new ShipmentService_3_2Client();
var objAuth = new authentication {
delisId = "######",
authToken = objAuthToken.authToken,
messageLanguage = "#####",
};
var objPrinter = new printOptions {
printerLanguage = printOptionsPrinterLanguage.PDF,
paperFormat = printOptionsPaperFormat.A6,
};
var objSenderAddress = new address {
name1 = "IML GDN",
street = "Nurnberger Straue 12",
city = "Dusseldorf",
country = "DE",
zipCode = "40599",
customerNumber = "03180008",
};
var objRecipientAddress = new address {
name1 = "Nikolas Meyer",
street = "Nurnberger Str 12",
city = "Dusseldorf",
country = "DE",
zipCode = "40599",
};
var objShipmentData = new generalShipmentData {
identificationNumber = "12345",
sendingDepot = "0147",
product = generalShipmentDataProduct.CL,
sender = objSenderAddress,
recipient = objRecipientAddress,
};
var objParcels = new parcel
{
customerReferenceNumber1 = "PDS124400203",
};
var objProductService = new productAndServiceData
{
orderType = productAndServiceDataOrderType.consignment,
};
var objShipmentServiceData = new shipmentServiceData
{
generalShipmentData = objShipmentData,
parcels = new[] {objParcels},
productAndServiceData = objProductService,
};
var objStoreOrder = new storeOrders
{
printOptions = objPrinter,
order = new[] { objShipmentServiceData },
};
storeOrdersResponse objShipmentResponse = new storeOrdersResponse();
**objShipmentResponse = objShipment.storeOrders(objAuth, objStoreOrder);** here is the line that produces the error: Cannot find the declaration of element 'ActivityId'
}
}
Hope this helps anyone else who comes across error: Cannot find declaration element 'ActivityId'. The problem is related to the Activity Tracing feature being turned on while making API calls to Java Web Services.
Disabling the ActivityTracing in Web.Config did the trick. Remove the words ActivityTracing and set propagateActivity to false:
<sources>
<source name="System.ServiceModel.MessageLogging" switchValue="Verbose">
<listeners>
<add type="System.Diagnostics.DefaultTraceListener" name="Default">
<filter type="" />
</add>
<add name="ServiceModelMessageLoggingListener">
<filter type="" />
</add>
</listeners>
</source>
<source name="System.ServiceModel" switchValue="Verbose" propagateActivity="false">
<listeners>
<add type="System.Diagnostics.DefaultTraceListener" name="Default">
<filter type="" />
</add>
<add name="ServiceModelTraceListener">
<filter type="" />
</add>
</listeners>
</source>
</sources>