Click here to Skip to main content
15,887,135 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionPenny for Pay question Pin
BrianStrong28-Sep-15 14:10
BrianStrong28-Sep-15 14:10 
AnswerRe: Penny for Pay question Pin
Richard MacCutchan28-Sep-15 21:43
mveRichard MacCutchan28-Sep-15 21:43 
AnswerRe: Penny for Pay question Pin
Chris Quinn29-Sep-15 0:53
Chris Quinn29-Sep-15 0:53 
AnswerRe: Penny for Pay question Pin
Matt T Heffron29-Sep-15 10:35
professionalMatt T Heffron29-Sep-15 10:35 
QuestionPlease explain this. Pin
Member 1201796828-Sep-15 11:40
Member 1201796828-Sep-15 11:40 
AnswerRe: Please explain this. Pin
Dave Kreskowiak28-Sep-15 12:22
mveDave Kreskowiak28-Sep-15 12:22 
QuestionImport data from photon Pin
Member 1051522527-Sep-15 19:10
professionalMember 1051522527-Sep-15 19:10 
Questionconverting a embedded xml file resource to a xml object Pin
jkirkerx23-Sep-15 9:51
professionaljkirkerx23-Sep-15 9:51 
I'm working on a API, in which you can't get a fake answer back from the test server, so you have to use the production server. On top of that, if you use the same tracking number too many times, it's shuts you off.

So I thought I'd just create a XML file as an embedded resource in my DLL, and just load it and parse it. So I'm loading this XML file, and I want to turn it into a SOAP response, so I can finish writing the code to parse it. I had a problem with getting rid of the BOM marker, so I converted it to a string, so I can rewrite it as an object.

Now I get a error in XML, Line 2,2
Maybe this is more trouble than it's worth. Maybe I misssed something here, like serializer.
Public Shared Function BloomingtonCA() As trackService.TrackReply

        Dim serializer As XmlSerializer = Nothing
        serializer = New XmlSerializer(GetType(trackService.TrackReply))
        AddHandler serializer.UnknownNode, AddressOf serializer_UnknownNode
        AddHandler serializer.UnknownAttribute, AddressOf serializer_UnknownAttribute

        Dim fileStream As Stream = Assembly.GetExecutingAssembly.GetManifestResourceStream("FedExCorp.bloomingtonCA.xml")
        Dim bytes As Byte() = New Byte(fileStream.Length) {}
        fileStream.Position = 0
        fileStream.Read(bytes, 0, fileStream.Length)
        Dim rxn_string As String = Encoding.UTF8.GetString(bytes).Replace("???", "")

        Dim rxnStream As New IO.MemoryStream
        Dim utf8 As Encoding = New UTF8Encoding()
        Dim writer = New XmlTextWriter(rxnStream, utf8)
        writer.WriteRaw(rxn_string)
        writer.Flush()
        rxnStream.Position = 0

        Dim reader = New StreamReader(rxnStream)
        Dim rateReply As New trackService.TrackReply()
        rateReply = CType(serializer.Deserialize(reader), trackService.TrackReply) 'XML Error here
        If Not (reader Is Nothing) Then reader.Close()

        Return rateReply

    End Function
<?xml version="1.0" encoding="utf-8" ?>
<TrackReply xmlns="http://fedex.com/ws/track/v10" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
  <HighestSeverity>SUCCESS</HighestSeverity>
  <Notifications>
    <Severity>SUCCESS</Severity>
    <Source>trck</Source>
    <Code>0</Code>
    <Message>Request was successfully processed.</Message>
    <LocalizedMessage>Request was successfully processed.</LocalizedMessage>
  </Notifications>

Answer[Cancel That] Pin
jkirkerx23-Sep-15 11:36
professionaljkirkerx23-Sep-15 11:36 
QuestionEmbedded Windows Media Player stream playing query Pin
Magrat23-Sep-15 8:26
Magrat23-Sep-15 8:26 
QuestionHOw I can find a sent mail with vba? Pin
Member 1199849020-Sep-15 13:21
Member 1199849020-Sep-15 13:21 
AnswerRe: HOw I can find a sent mail with vba? Pin
Dave Kreskowiak25-Sep-15 14:56
mveDave Kreskowiak25-Sep-15 14:56 
QuestionCan radio buttons have more than 1 function? Pin
Member 1199784020-Sep-15 3:55
Member 1199784020-Sep-15 3:55 
SuggestionRe: Can radio buttons have more than 1 function? Pin
Maciej Los20-Sep-15 5:32
mveMaciej Los20-Sep-15 5:32 
GeneralRe: Can radio buttons have more than 1 function? Pin
Member 1199784020-Sep-15 5:46
Member 1199784020-Sep-15 5:46 
GeneralRe: Can radio buttons have more than 1 function? Pin
Maciej Los20-Sep-15 5:59
mveMaciej Los20-Sep-15 5:59 
QuestionNavigating folders in listview. Pin
GeekyGirlPanacea17-Sep-15 0:29
GeekyGirlPanacea17-Sep-15 0:29 
AnswerRe: Navigating folders in listview. Pin
Brisingr Aerowing17-Sep-15 0:48
professionalBrisingr Aerowing17-Sep-15 0:48 
GeneralRe: Navigating folders in listview. Pin
GeekyGirlPanacea17-Sep-15 1:02
GeekyGirlPanacea17-Sep-15 1:02 
AnswerRe: Navigating folders in listview. Pin
Richard MacCutchan17-Sep-15 0:51
mveRichard MacCutchan17-Sep-15 0:51 
GeneralRe: Navigating folders in listview. Pin
GeekyGirlPanacea17-Sep-15 1:04
GeekyGirlPanacea17-Sep-15 1:04 
GeneralRe: Navigating folders in listview. Pin
Richard MacCutchan17-Sep-15 1:21
mveRichard MacCutchan17-Sep-15 1:21 
GeneralRe: Navigating folders in listview. Pin
GeekyGirlPanacea17-Sep-15 16:17
GeekyGirlPanacea17-Sep-15 16:17 
QuestionVisual Basic program to recursively take ownership of a folder and all its sub-contents Pin
Member 1186689316-Sep-15 7:15
Member 1186689316-Sep-15 7:15 
AnswerRe: Visual Basic program to recursively take ownership of a folder and all its sub-contents Pin
Wendelius16-Sep-15 7:44
mentorWendelius16-Sep-15 7:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.