last day (35 days later) » 

5:56 PM
1
A: IRS-A2A BulkRequestTransmitter message not formmatted properly and/or cannot be interpreted

fatherOfWineDon't know if it will resolve your issue, but nevertheless i give it a shot. Sometimes help comes from very unexpected sources :) First of all timestamp fields are in a wrong format: one in businessheader should NOT contain milliseconds at all. I know it for a fact. In security header timestamp...

 
Thank you very much for your detailed response. In one of their documents I thought I had seen the Business Header Timestamp having milliseconds. Apparently, I imagined that cause I definitely can't find the reference when reviewing the documents; so I have fixed that. My Security Header timestamps, look proper according to the sample in the Composition Guide. Thanks for catching that the OriginalReceiptId was still present and not populated. I have removed it. I also have made sure that the SoftwareID is being populated (not sure why this wasn't there either).
Here is how I ended up signing my request. It got me around the "WS-Security is Invalid" error, at least for the Transmittal. I am still receiving it when making a request for the Status. However, there could be an error on my part with that, I haven't had a chance to go back and review it as I've been concentrating on getting the Transmittal to work.
Unfortunately, I don't think I can add the "ds" prefix to the signature, after the signature has been computed. When doing so, the signature is unable to be verified.
 
u r welcome. Programmes have to help each other, rnt we?:)Yes, composition guide is not right is not right on account of businessheader timestamp.:) How I know it is true? I've got error message in the response complaining about it.:) After I removed miliseconds service started to complain about binarysecuritytoken.:) Thank for the hint about creating a signature. I've created signature myself before, but in my version I haven't been able create SecurityTokenReference element with KeyIdentifier theyare looking for. Do you know by any chance how to generate that?
 
After signing, I create a new <KeyInfo> element structure (according to the composition guide) and populate it with the required values. Then, I am replacing the <KeyInfo> element which was generated by the signing, with this new element just created. This does not have an effect on the signature, because they KeyInfo is outside of what is signed.
After a bit of working I found this link which I was able to use to add the "ds" prefix to my Signature elements and re-sign my request. I have verified that the "ds" prefix was pre-pended to each element (as shown in the Composition Guide) and that the Signature could to be verified successfully. I did have to make some changes to the Signing method. Unfortunately, I am still stuck on the error initially reported above.
Alright, I have the ACABusinessHeader element between the Security element and the Manifest element. Can I assume that you are creating the SOAP XML by hand and populating the values as necessary. How are you sending the request? Would you mind providing examples of how you utilized the custom GZipMessageEncoder and the custom MtomMessageEncoder (I have not seen this one yet).
 
@Russ I've Updated my answer. Hope you would be able make sense out of it.:)
 
This is great, thanks! Previous incarnations of my code, seemed to put me in the same block as the ballpark, as I had previously integrated the GZipMessageEncoding project from MSDN, and looked into the SoapWithAttachments project previously. Question: Do you have a link to the MtomEncoder classes? I presume it is similar in fashion to the GZIP stuff.
When referencing the MtomEncoder do you actually mean the SwaEncoder from the example at the link? If so, then I presume you had renamed SwaEncoder (and references) from Swa to Mtom. Where there any additional changes to the SoapWithAttachments that you made, other than what you had mentioned above? Thanks so much.
 
5:56 PM
@Russ Yep. I've renamed SwaEncoder into MtomEncoder. Forgot to mention that. My bad. On account of additional changes: I think I've mentioned everything I've done.... At least as I remember.:) Do you have any issues?
 
I think I have most everything setup as far as the class files go. However, I'm a little lost when it comes to integrating the two encoders: MtomEncoder and GZipEncoder. GZipEncoder is auto-magically integrated through the app.config. It looks like MtomEncoder is setup simply by getting called from GZipEncoder. You only mention setting up the MtomEncoder class, can I ignore the other classes: EncoderFactory, BindingElement, EncodingElement, etc? SetupMTOM method: This looks to setup the MIME information appropriately, but where does it get called?
 
@Russ No, no, no. You cannot ignore them. GzipMessageEncoder uses MtomEncoder. GZipMessageEncoder is main character here. All those classes are required by WCF framework. SetupMtom() method is called from GZipMessageEncode constructor. I've updated my answer with missing code.
 
if we are using the GZipMessageEncoder constructor and it (now) contains two parameters (the original code base only contained the MessageEncoder object), what are we passing in as the GZipMessageEncoderFactory parameter when creating a new instance of the GZipMessageEncoder from the GZipMessageEncoderFactory class?
 
@Russ Jee, it was more elaborate, then I thought!:) I'll update my answer with missing code.
 
Additionally, I'm receiving an error which states Unable to cast object of type 'System.ServiceModel.Channels.TextMessageEncoderFactory' to type 'GZipEncoder.GZipMessageEncoderFactory'. It seems to be occuring when I create a new OperationContextScope(client.InnerChannel) when attempting to submit the request. I use the OperationContext to add the Content-Encoding and Content-Transfer-Encoding properties and values to a HttpRequestMessageProperty object.
It looks like the BuildChannelFactory<TChannel>(BindingContext context) method in GZipMessageEncodingBindingElement fires, this goes into the GZipMessageEncoderFactory(MessageEncoderFactory messageEncoderFactory) method, and errors on encoder = new GZipMessageEncoder(messageEncoderFactory.Encoder, this);
 
5:56 PM
@Russ Verify what type _Factory in GZipMessageEncoder has. It should be GZipMessageEncoderFactory.
 
Looks like the error I was experiencing may have been because the two projects weren't building properly. (I would like these in a single project) One of those "gotchas". :( I was successfully able to debug into the WriteMessage method of the GZipMessageEncoder class.
 
@ACA-Ken No, I do not.
@Russ Listen I would like to ask you for a favor. I do not have enough credits to comment, but I would like to Ask Bon(he claimed in comments, that he got it working) what was his solution for the status service? Was it certificate or signature generation? Here is the link:stackoverflow.com/questions/35182951/… If you would be able to ask him I would appreciate it.
 
@fatherOfWine There is a lot of information in the answer comments. You should be able to post something there (if you can't post an answer as your question). It looks like Bon edited his answer as a notification that he could not get WCF to work properly.
 
@Russ He also claimed, that he got both services working and he has same issue: submit service working and status service getting "WS Security is invalid" error. Here is his comment:"Ok, I DID get this working finally for the RequestSubmissionStatusDetail as well. So I know my solution works now for both endpoints. "(c) But, unfortunately he didn't go into any details what he has done to make it work.
@Russ Have you been able to put submit service to work, btw?
 
@fatherOfWine Unfortunately, I haven't been able to get any of it to work yet. :( I believe he has come up with a solution but, numerous times he has said he is unable to share any code due to contractual obligations with whatever company he is employed by. Which is unfortunate for all of us struggling.
 
5:56 PM
@Russ I thought if he would be able to tell what was it, that made his solution to work, that's would be interesting to know.. We could write own code!;) What seems to be a hold up?
 
@fatherOfWine I ran out of time Friday after fixing the errors I was running into with your suggestions. At the moment, I have a class library setup with the GZip and Mtom encoders and a reference within the application project to the class library. I wasn't having any luck getting the app.config entries working when I had the class files directly in the application project.
 
@Russ app.config contains reference to GZipMessageEncoder. So you need to instruct WCF where that class lives. Just check item 1.1 and 1.3 in my last update and verify what namespace is there for the GZipMessageEncoder class. Make sure, that your config contains proper namespace for the custom encoder class.
 
Yes, that is what I have in my app.config. When I have a class library project setup (and added as a Reference in the application), the configuration entry works. However, when I attempt to move the class file for the Encoders into the application project (having the same namespaces as in the class library), I receive an error on the declaration of the new client instance which tells me that "the type registered for the extension could not be loaded."
 
Why are you trying to move encoder files into application project? It's not necessary. Just make sure, that namespace is correct.
 
6:13 PM
Where/how are you doing the signing?
I guess another question is: Did you integrate these encoders with the Proxy Classes (generated from the WSDL) or are you creating the SOAP XML request manually?
 
Signing is done in the WriteMessage() by 4.SignEnvelope() method(item 4.2.) I've skipped it, because I've figured you already have it.
 
I do. I was confused as to where to put that particular code because I had it in the application. Which is why I think I was trying to integrate the Encoders into the application (instead of the separate class library project).
 
Encoders are living in their own assembly. I am doing signing using SignedXmlWithId class, which I borrowed, if my memory serves me correctly, from you.:)
 
I'm understanding now, and that you would be correct on. :)
 
c? sometimes I DO remember!:))
Basically idea was to take whatever message WCF has generated and add proper signature to it.
 
6:26 PM
:) Just to confirm, you have the Transmittal working through WCF?
 
Yes.
I was lazy to write all those pure HTTP stuff.:)
 
So far, I've done both with similar results. >_<
 
6:40 PM
Well it took me a while to put everything together, to be totally honest with you. But what I don't understand is why what's working for submit service does not work for status one.
That's why I was trying to tract down Bon. And I did.:) But unfortunately he didn't share what was that difference, that made his solution work for status service. At least so far... Maybe I would be able to get some response from him, which would be shed some light on the problem... we'll c.
 
What is the error you are receiving on the status service?
 
WS Security header is invalid.
Whic is totally does not kame any scense.
kame=make
What error do you get on your call to status service?
 
6:56 PM
Same one. But that was also in the other solution: creating the SOAP calls by "hand" vs. WCF.
 
Crazy question: are u MTOMing request to status service?
 
I don't think you'd have to Mtom the status request, since there is no attachment involved. However, you would still need to GZip the request. With that said, you might have to Mtom it.
Are you using the SecurityHeaderType from the WSDL, or creating the Security elements when you doing the Signing in the WriteMessage method of the GZipEncoder. Additionally, are you replacing the KeyInfo element?
 
I am creating Security element by hands in WriteMessage. Yes, I am replacing KeyInfo with that KeyIdentifier stuff.
 
7:28 PM
Excellent. That's what I figured.
 
And my signature is prefixless
 
Ultimately I believe you should be using the same signature/code for the Submission and the Status request. I don't see a reason why that wouldn't be correct.
 
Well, I don't see either and yet status service does not like the output, which submit one eats up gladly! This puzzles me beyond recognition!:(
 
The entire project has been that way for me. :( The saving grace is that I'm not the only one!
 
 
1 hour later…
8:40 PM
Do you remove the element VsDebuggerCausalityData from the request?
 
Yes. You could look at the code where I am calling a service how to remove that stuff.
 
Oh, I didn't realize you added more code to the post. Thanks so much! I'm working on creating the Signature at the moment.
Are you changing your namespaces of the request objects at all? For example, my soap envelope and header objects have a prefix of "s"; whereas before I had a prefix of "soapenv". I know that the prefix doesn't entirely matter, but I thought I'd ask as it is a decent amount of work to correct some of the code where I was using the "soapenv" prefix.
 
8:59 PM
Prefixes does not matter.
my envelope also has prfix s
Thugh I use wsse for security, but just because it's historically occurred that way.
 
Are you creating the entire Security element by hand, or only the signature part of the element? I was looking at using the SecurityHeaderType and its related TimestampType instead of creating those manually.
arguably it can be done either way :)
 
Yes
I've copied it over from somewhere. Pure xml.
 
Alright. Quite possibly from me :) I know I have that piece somewhere.
 
I do it manually, but I guess it could be done either way.
It could be from u, no doubt.:)
 
9:21 PM
Does your MtomEncoder class only have two parameters (MessageEncoder, MtomEncoderFactory)?
I have a third which is a string attachmentContentType
The MtomEncoder class has _Factory defined as type MtomEncoderFactory. This is used as the 2nd parameter of the MtomEncoder method. However, in the code related to 4.3 of your post, in the ReadMessage method of the GZipMessageEncoder class, you are passing in _Factory which is defined as a GZipEncoderFactory (as it belongs to the GZip classes).
 
9:37 PM
Yes, MtomEncoder constructor has only 2 params:MessageEncoder innerEncoder, GZipMessageEncoderFactory factory
_Factory should be of GZipEncoderFactory type.
 
The ATTACHMENT_PROP constant represents what ... it says "attachment_file_content" ... is that the string representation of the Form Data file?
Also, I updated the MtomEncoder method to only have two parameters: MessageEncoder & GZipMessageEncoderFactory. And updated the _Factory variable to type "protected readonly GZipMessageEncoderFactory"; and now I get two "Inconsistent accessibility" errors: one on the protected readonly _Factory variable, and one on the MtomEncoder method.
 
Nope. It's value you could use to get content of the attachment from OperrationContext.Current.OutgoingMessageProperties if that's your inclanation. I do not use it. I wasn't sure how I would I transfer data to encoder.:)
 
You don't use it? But its part of the ReadMessage method in the MtomEncoder class?
 
9:54 PM
What access modifier GZipMessageEncoderFactory has? I have "internal" on it.
Oh, I am sorry. I AM using it(but not realy).:)) It was a long day.:) I am placing there possible attachment from the response, but it not here, so this piece of code is not gonna be relevant for this particular case.
here=there
Under "piece of code" I meant lise, with attachment_prop constant. I am got to go now. C u tomorrow.
lise=code
 
10:12 PM
yes the GZipMessageEncoderFactory class is marked as "internal".
 
10:25 PM
I turned the GZipMessageEncoderFactory to "public" and did clear up the error; not sure it's 100% correct, but it is working.
 
11:04 PM
I am also curious as to how you reference the content id for the attachment. Are you manually adding the BulkExchangeFile element to the ACABulkRequestTransmitter element, then manually adding an <Include> element containing the href to the attachment content?
 

  last day (35 days later) »